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