feat: 调整项目结构
This commit is contained in:
1
src/store/index.js
Normal file
1
src/store/index.js
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./modules";
|
||||
26
src/store/modules/app.js
Normal file
26
src/store/modules/app.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
export const useAppStore = defineStore("app", {
|
||||
state() {
|
||||
return {
|
||||
title: "",
|
||||
sceneId: "",
|
||||
hasToken: false,
|
||||
};
|
||||
},
|
||||
getters: {},
|
||||
|
||||
actions: {
|
||||
setData(data) {
|
||||
this.title = data;
|
||||
},
|
||||
setSceneId(data) {
|
||||
this.sceneId = data;
|
||||
},
|
||||
setHasToken(data) {
|
||||
this.hasToken = data;
|
||||
},
|
||||
},
|
||||
|
||||
unistorage: true,
|
||||
});
|
||||
3
src/store/modules/index.js
Normal file
3
src/store/modules/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { useAppStore } from "./app";
|
||||
|
||||
export { useAppStore };
|
||||
Reference in New Issue
Block a user