mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-15 09:48:14 +08:00
feat(dev): 新建开发者页面,用于数据处理
This commit is contained in:
28
src/store/modules/dev.ts
Normal file
28
src/store/modules/dev.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { defineStore } from "pinia";
|
||||
|
||||
const useDevStore = defineStore({
|
||||
id: "dev",
|
||||
state() {
|
||||
return {
|
||||
showDev: false,
|
||||
magicCount: 0,
|
||||
};
|
||||
},
|
||||
actions: {
|
||||
addMagic() {
|
||||
if (!this.showDev) {
|
||||
this.magicCount++;
|
||||
if (this.magicCount >= 5) {
|
||||
this.toggleDev();
|
||||
}
|
||||
}
|
||||
},
|
||||
toggleDev() {
|
||||
this.showDev = !this.showDev;
|
||||
this.magicCount = 0;
|
||||
},
|
||||
},
|
||||
persist: false,
|
||||
});
|
||||
|
||||
export default useDevStore;
|
||||
Reference in New Issue
Block a user