Skip to content

saofeng-cyber/pinia-sf-persistence-storage

Repository files navigation

Artwork from Pinia

pinia-sf-persistence-storage

Configurable persistence and rehydration of Pinia stores.

Version License: MIT

🚀 Quickstart

安装

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;
}

Author

👤 saofeng

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

📝 License