gohttpdUi/src/store/index.ts

23 lines
406 B
TypeScript
Raw Normal View History

2022-09-30 16:52:39 +08:00
// TODO: 感觉这样是有问题的,但目前还没想到更好的办法
import { createPinia } from 'pinia'
2022-09-30 16:52:39 +08:00
import { createApp } from 'vue'
import App from '../App.vue'
import { createPersistedState } from 'pinia-plugin-persistedstate'
const app = createApp(App)
const store = createPinia()
2022-09-30 16:52:39 +08:00
store.use(
createPersistedState({
storage: sessionStorage
})
)
2022-02-19 09:46:33 +08:00
2022-09-30 16:52:39 +08:00
app.use(store)
export { store }