fix(store): 微改

This commit is contained in:
BTMuli
2023-03-22 15:59:06 +08:00
parent f7b2a6cbb7
commit 95203fb86e
2 changed files with 12 additions and 2 deletions

View File

@@ -24,12 +24,18 @@ const useAchievementsStore = defineStore({
init() {
this.total_achievements = 899;
this.fin_achievements = 0;
this.title = "成就完成数0/899 完成率0%";
this.title = this.getTitle();
},
flushData(total: number, fin: number) {
this.total_achievements = total;
this.fin_achievements = fin;
this.title = `成就完成数:${fin}/${total} 完成率:${((fin / total) * 100).toFixed(2)}%`;
this.title = this.getTitle();
},
getTitle() {
return `成就完成数:${this.fin_achievements}/${this.total_achievements} 完成率:${(
(this.fin_achievements / this.total_achievements) *
100
).toFixed(2)}%`;
},
},
persist: true,

View File

@@ -46,6 +46,10 @@ const useAppStore = defineStore({
actions: {
// 初始化配置
async init() {
// 防止数据清空
if (this.sidebar === undefined) {
this.sidebar = true;
}
// 初始化加载状态
this.loading = false;
// 初始化咨讯页渲染模式