Artwork from Pinia
Configurable persistence and rehydration of Pinia stores.
pnpm add @saofeng_cyber/pinia-sf-persistence-storage
或者
yarn add @saofeng_cyber/pinia-sf-persistence-storage
或者
npm add @saofeng_cyber/pinia-sf-persistence-storage
在入口文件 main.ts
使用
import { createApp } from "vue";
import { createPinia } from "pinia";
import { myPiniaStoragePlugin } from "@saofeng_cyber/pinia-sf-persistence-storage";
import App from "./App.vue";
const app = createApp(App);
const pinia = createPinia();
pinia.use(myPiniaStoragePlugin);
app.use(pinia).mount("#app");
export interface PersistType {
interface PersistType {
/**
* @enable 是否要开启缓存
*/
enable: boolean;
/**
* @key 存储的key值
*/
key: string;
/**
* @storageType 存储的类型
*/
storageType: StorageType;
/**
* @encypto 是否加密
*/
isEncrypto: boolean;
}
👤 saofeng
- Github: @saofeng-cyber
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
📝 License