fix: 混合侧栏一键进入子页并开启路由进度条,消除首次点菜单无反馈

This commit is contained in:
2026-09-23 10:56:57 +08:00
parent 5b15c01606
commit 8b035ebca5
2 changed files with 7 additions and 3 deletions
@@ -10,7 +10,7 @@ import type {
import { markRaw, reactive, readonly, watch } from 'vue';
import { StorageManager } from '@vben-core/shared/cache';
import { MemoryStorageDriver, StorageManager } from '@vben-core/shared/cache';
import { isMacOs, merge } from '@vben-core/shared/utils';
import {
@@ -40,7 +40,8 @@ class PreferenceManager {
private state: Preferences;
constructor() {
this.cache = new StorageManager();
// 初始化完成前不用 LocalStorage,避免空 prefix 警告与误清全站存储
this.cache = new StorageManager({ driver: new MemoryStorageDriver() });
// 构造函数不再同步读取缓存,使用默认值初始化
// 真正的缓存加载在 initPreferences 中完成(已经是 async)
this.state = reactive<Preferences>({ ...defaultPreferences });