TopNav开关事件控制

master
RuoYi 12 months ago
parent 64036d520f
commit 5186e2be77
  1. 10
      src/layout/components/Settings/index.vue

@ -38,7 +38,7 @@
<div class="drawer-item"> <div class="drawer-item">
<span>开启 TopNav</span> <span>开启 TopNav</span>
<span class="comp-style"> <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> </span>
</div> </div>
@ -98,6 +98,14 @@ const sideTheme = ref(settingsStore.sideTheme);
const storeSettings = computed(() => settingsStore); const storeSettings = computed(() => settingsStore);
const predefineColors = ref(["#409EFF", "#ff4500", "#ff8c00", "#ffd700", "#90ee90", "#00ced1", "#1e90ff", "#c71585"]); 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) { function themeChange(val) {
settingsStore.theme = val; settingsStore.theme = val;
handleThemeStyle(val); handleThemeStyle(val);

Loading…
Cancel
Save