mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
fix(store): 微改
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -46,6 +46,10 @@ const useAppStore = defineStore({
|
||||
actions: {
|
||||
// 初始化配置
|
||||
async init() {
|
||||
// 防止数据清空
|
||||
if (this.sidebar === undefined) {
|
||||
this.sidebar = true;
|
||||
}
|
||||
// 初始化加载状态
|
||||
this.loading = false;
|
||||
// 初始化咨讯页渲染模式
|
||||
|
||||
Reference in New Issue
Block a user