mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-09 08:48:21 +08:00
fix(dev): 页面加载逻辑优化
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
</template>
|
||||
<v-list-item-title v-show="!rail"> 成就 </v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-subheader v-show="!rail">
|
||||
<v-list-subheader v-show="!rail" @click="getDev()">
|
||||
<v-icon>mdi-rocket-outline</v-icon>
|
||||
<span> 预期功能 </span>
|
||||
</v-list-subheader>
|
||||
@@ -51,7 +51,7 @@
|
||||
<template v-slot:prepend>
|
||||
<v-icon>mdi-cog-outline</v-icon>
|
||||
</template>
|
||||
<v-list-item-title v-show="!rail" @click="getDev"> 设置 </v-list-item-title>
|
||||
<v-list-item-title v-show="!rail"> 设置 </v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link href="/dev" v-show="showDev">
|
||||
<template v-slot:prepend>
|
||||
@@ -97,7 +97,11 @@ export default defineComponent({
|
||||
},
|
||||
getDev() {
|
||||
const devStore = useDevStore();
|
||||
devStore.addMagic();
|
||||
devStore.magicCount++;
|
||||
if (devStore.magicCount >= 10) {
|
||||
devStore.showDev = true;
|
||||
}
|
||||
console.log(devStore.magicCount);
|
||||
this.showDev = devStore.showDev;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,10 +1,27 @@
|
||||
<template></template>
|
||||
<template>
|
||||
<h1>开发</h1>
|
||||
<v-card>
|
||||
<v-list>
|
||||
<v-list-item @click="initDev()" prepend-icon="mdi-refresh">
|
||||
<v-list-item-title>初始化开发</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import useDevStore from "../store/modules/dev";
|
||||
|
||||
export default defineComponent({
|
||||
name: "Dev",
|
||||
methods: {
|
||||
initDev() {
|
||||
const devStore = useDevStore();
|
||||
devStore.showDev = false;
|
||||
devStore.magicCount = 0;
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,21 +8,7 @@ const useDevStore = defineStore({
|
||||
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,
|
||||
persist: true,
|
||||
});
|
||||
|
||||
export default useDevStore;
|
||||
|
||||
Reference in New Issue
Block a user