TopNav开关事件控制

This commit is contained in:
RuoYi 2023-12-01 21:53:23 +08:00
parent 64036d520f
commit 5186e2be77
1 changed files with 9 additions and 1 deletions

View File

@ -38,7 +38,7 @@
<div class="drawer-item">
<span>开启 TopNav</span>
<span class="comp-style">
<el-switch v-model="settingsStore.topNav" class="drawer-switch" />
<el-switch v-model="settingsStore.topNav" @change="topNavChange" class="drawer-switch" />
</span>
</div>
@ -98,6 +98,14 @@ const sideTheme = ref(settingsStore.sideTheme);
const storeSettings = computed(() => settingsStore);
const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]);
/** 是否需要topnav */
function topNavChange(val) {
if (!val) {
appStore.toggleSideBarHide(false);
permissionStore.setSidebarRouters(permissionStore.defaultRoutes);
}
}
function themeChange(val) {
settingsStore.theme = val;
handleThemeStyle(val);