kun-galgame-vue/src/store/index.ts

27 lines
659 B
TypeScript
Raw Normal View History

import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import type { App } from 'vue'
// 导入用户 store
import { useKUNGalgamerStore } from '@/store/modules/kungalgamer'
2023-04-20 15:34:48 +00:00
// 导入网站设置面板 store
import { useKUNGalgameSettingsStore } from '@/store/modules/settings'
2023-04-20 15:34:48 +00:00
const store = createPinia()
export function setupPinia(app: App<Element>) {
store.use(piniaPluginPersistedstate)
app.use(store)
}
export function storeReset() {
const userStore = useKUNGalgamerStore()
const settingsStore = useKUNGalgameSettingsStore()
userStore.$reset()
2023-06-14 14:51:50 +00:00
settingsStore.$reset()
}
export { store }