🐛 fix(init): 修复初始化未重新加载的问题

This commit is contained in:
BTMuli
2023-04-13 17:46:00 +08:00
parent ea5ff8bd65
commit 513be2ed52
2 changed files with 9 additions and 1 deletions

View File

@@ -297,6 +297,7 @@ async function delUserData () {
// 恢复默认配置 // 恢复默认配置
function initAppData () { function initAppData () {
appStore.init();
homeStore.init(); homeStore.init();
achievementsStore.init(); achievementsStore.init();
snackbarText.value = "已恢复默认配置!"; snackbarText.value = "已恢复默认配置!";

View File

@@ -2,7 +2,7 @@
* @file store modules app.ts * @file store modules app.ts
* @description App store module * @description App store module
* @author BTMuli<bt-muli@outlook.com> * @author BTMuli<bt-muli@outlook.com>
* @since Alpha v0.1.2 * @since Alpha v0.1.3
*/ */
// vue // vue
@@ -56,6 +56,12 @@ export const useAppStore = defineStore(
achievements: `${dataPath.userDataDir}/achievements.json`, achievements: `${dataPath.userDataDir}/achievements.json`,
}); });
// 初始化
function init (): void {
loading.value = false;
devMode.value = false;
}
function getSubmenu (): string[] { function getSubmenu (): string[] {
const open = []; const open = [];
if (sidebar.submenu.database) open.push("database"); if (sidebar.submenu.database) open.push("database");
@@ -70,6 +76,7 @@ export const useAppStore = defineStore(
dataPath, dataPath,
appPath, appPath,
userPath, userPath,
init,
getSubmenu, getSubmenu,
}; };
}, },