index.js 364 B

12345678910111213
  1. // pinia数据持久化存储
  2. import { createPinia } from "pinia"
  3. import { createPersistedState } from 'pinia-plugin-persistedstate'
  4. const store = createPinia()
  5. store.use(createPersistedState({
  6. serializer: { // 指定参数序列化器
  7. serialize: JSON.stringify,
  8. deserialize: JSON.parse,
  9. }
  10. }))
  11. export default store