refactor: 界面重构美化
This commit is contained in:
@@ -15,6 +15,7 @@ export const useAppStore = defineStore("app", () => {
|
||||
withoutAnimation: false,
|
||||
});
|
||||
const activeTopMenuPath = useStorage(STORAGE_KEYS.ACTIVE_TOP_MENU_PATH, "");
|
||||
const contentFullscreen = ref(false);
|
||||
|
||||
const locale = computed(() => (language?.value === "en" ? en : zhCn));
|
||||
|
||||
@@ -49,6 +50,10 @@ export const useAppStore = defineStore("app", () => {
|
||||
activeTopMenuPath.value = val;
|
||||
}
|
||||
|
||||
function toggleContentFullscreen() {
|
||||
contentFullscreen.value = !contentFullscreen.value;
|
||||
}
|
||||
|
||||
return {
|
||||
device,
|
||||
sidebar,
|
||||
@@ -56,12 +61,14 @@ export const useAppStore = defineStore("app", () => {
|
||||
locale,
|
||||
size,
|
||||
activeTopMenu,
|
||||
contentFullscreen,
|
||||
toggleDevice,
|
||||
changeSize,
|
||||
changeLanguage,
|
||||
toggleSidebar,
|
||||
closeSideBar,
|
||||
openSideBar,
|
||||
toggleContentFullscreen,
|
||||
activeTopMenuPath,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -32,6 +32,12 @@ export const useSettingsStore = defineStore("setting", () => {
|
||||
// 主题
|
||||
const theme = useStorage<ThemeMode>(STORAGE_KEYS.THEME, defaults.theme);
|
||||
const themeColor = useStorage(STORAGE_KEYS.THEME_COLOR, defaults.themeColor);
|
||||
|
||||
// 旧默认值 → 新默认值 自动迁移(用户自定义的颜色不会被覆盖)
|
||||
const LEGACY_DEFAULTS = ["#4080FF", "#4080ff", "#2563EB", "#2563eb"];
|
||||
if (LEGACY_DEFAULTS.includes(themeColor.value)) {
|
||||
themeColor.value = defaults.themeColor;
|
||||
}
|
||||
const resolvedTheme = ref<ThemeMode>(resolveThemeMode(theme.value));
|
||||
|
||||
// 特殊模式
|
||||
|
||||
@@ -218,6 +218,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
|
||||
title: route.meta.title as string,
|
||||
path: route.path,
|
||||
fullPath: route.fullPath,
|
||||
icon: route.meta?.icon as string | undefined,
|
||||
affix: route.meta?.affix,
|
||||
keepAlive: route.meta?.keepAlive,
|
||||
query: route.query,
|
||||
|
||||
Reference in New Issue
Block a user