12345678910111213141516 |
- import type { Plugin } from 'vue'
- import { createPinia } from 'pinia'
- import { createPersistedState } from 'pinia-plugin-persistedstate'
- export default {
- install(app, options) {
- const pinia = createPinia()
- pinia.use(
- createPersistedState({
- key: (id) => `__${id}__`,
- storage: localStorage
- })
- )
- app.use(pinia, options)
- }
- } as Plugin
|