1.0.1 • Published 10 months ago
@neosjs/pinia-sync-store v1.0.1
@neosjs/pinia-sync-store
多窗口间 pinia store 共享数据
安装
pnpm add @neosjs/pinia-sync-store
npm install @neosjs/pinia-sync-store
yarn add @neosjs/pinia-sync-store
使用
import type { App } from 'vue'
import { createPinia } from 'pinia'
import { createPiniaSyncStore } from '@neosjs/pinia-sync-store'
const store = createPinia()
const install = (app: App<Element>): any => {
// 使用插件
store.use(createPiniaSyncStore({
enable: true, // 是否启用
persist: false // 是否持久化
}))
app.use(store)
}
export { install, store }