多窗口间 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 }