mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
feat(pinia): 添加 pinia 并做数据持久化
This commit is contained in:
@@ -2,5 +2,7 @@ import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
// 路由
|
||||
import router from "./router";
|
||||
// Pinia
|
||||
import { pinia } from "./store";
|
||||
|
||||
createApp(App).use(router).mount("#app");
|
||||
createApp(App).use(router).use(pinia).mount("#app");
|
||||
|
||||
8
src/store/index.ts
Normal file
8
src/store/index.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { createPinia } from "pinia";
|
||||
import { createPersistedState } from "pinia-plugin-persistedstate";
|
||||
|
||||
const pinia = createPinia();
|
||||
|
||||
pinia.use(createPersistedState());
|
||||
|
||||
export { pinia };
|
||||
Reference in New Issue
Block a user