unibest/src/store/index.ts

18 lines
355 B
TypeScript
Raw Normal View History

2023-12-22 15:12:44 +08:00
import { createPinia } from 'pinia'
import { createPersistedState } from 'pinia-plugin-persistedstate' // 数据持久化
2023-12-22 15:12:44 +08:00
const store = createPinia()
store.use(
createPersistedState({
storage: {
getItem: uni.getStorageSync,
setItem: uni.setStorageSync,
},
}),
)
2023-12-22 15:12:44 +08:00
export default store
2023-12-23 11:27:00 +08:00
// 模块统一导出
export * from './user'