feat: 导航混合

Former-commit-id: 5942884a809813c87b6e49cefd4343aa07169b91
This commit is contained in:
april
2023-08-14 18:20:51 +08:00
parent c471f3c68b
commit 52a5d064a5
6 changed files with 287 additions and 47 deletions

View File

@@ -14,11 +14,12 @@ export const useAppStore = defineStore("app", () => {
const language = useStorage("language", defaultSettings.language);
const sidebarStatus = useStorage("sidebarStatus", "closed");
const sidebar = reactive({
opened: sidebarStatus.value !== "closed",
withoutAnimation: false,
});
const activeTopMenu = useStorage("activeTop", "");
/**
* 根据语言标识读取对应的语言包
*/
@@ -68,18 +69,25 @@ export const useAppStore = defineStore("app", () => {
function changeLanguage(val: string) {
language.value = val;
}
/**
* 混合模式顶部切换
*/
function changeTopActive(val: string) {
activeTopMenu.value = val;
}
return {
device,
sidebar,
language,
locale,
size,
activeTopMenu,
toggleDevice,
changeSize,
changeLanguage,
toggleSidebar,
closeSideBar,
openSideBar,
changeTopActive,
};
});