mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
fix(store): 分开存储
This commit is contained in:
@@ -30,8 +30,6 @@ const useAppStore = defineStore({
|
||||
database: false,
|
||||
},
|
||||
},
|
||||
// 咨讯页渲染模式
|
||||
structureRender: true, // 是否采用结构化渲染,否则采用 raw 渲染
|
||||
// 开发者模式
|
||||
devMode: false,
|
||||
// 数据路径
|
||||
@@ -70,19 +68,15 @@ const useAppStore = defineStore({
|
||||
},
|
||||
// 初始化配置
|
||||
async init() {
|
||||
// 防止数据清空
|
||||
if (this.sidebar === undefined) {
|
||||
// 初始化侧边栏设置
|
||||
this.sidebar = {
|
||||
collapse: false,
|
||||
submenu: {
|
||||
database: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
// 初始化加载状态
|
||||
this.loading = false;
|
||||
// 初始化咨讯页渲染模式
|
||||
this.structureRender = true;
|
||||
// 初始化开发者模式
|
||||
this.devMode = false;
|
||||
// 初始化用户数据路径
|
||||
@@ -97,7 +91,23 @@ const useAppStore = defineStore({
|
||||
return open;
|
||||
},
|
||||
},
|
||||
persist: true,
|
||||
persist: [
|
||||
{
|
||||
key: "appPath",
|
||||
storage: window.localStorage,
|
||||
paths: ["dataPath", "appPath", "userPath"],
|
||||
},
|
||||
{
|
||||
key: "app",
|
||||
storage: window.localStorage,
|
||||
paths: ["devMode", "loading"],
|
||||
},
|
||||
{
|
||||
key: "sidebar",
|
||||
storage: window.localStorage,
|
||||
paths: ["sidebar"],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export default useAppStore;
|
||||
|
||||
Reference in New Issue
Block a user