fix(Sidebar.vue): 🐛 tag 标签选中菜单路由未关联着色问题修复
Former-commit-id: b79639a8013236ecb6382453df7b17cc0a0fce8c
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
import SidebarItem from "./SidebarItem.vue";
|
import SidebarItem from "./SidebarItem.vue";
|
||||||
import Logo from "./Logo.vue";
|
import Logo from "./Logo.vue";
|
||||||
|
|
||||||
@@ -11,7 +12,7 @@ import variables from "@/styles/variables.module.scss";
|
|||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
const permissionStore = usePermissionStore();
|
const permissionStore = usePermissionStore();
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
|
const currRoute = useRoute();
|
||||||
const { sidebarLogo } = storeToRefs(settingsStore);
|
const { sidebarLogo } = storeToRefs(settingsStore);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -20,6 +21,7 @@ const { sidebarLogo } = storeToRefs(settingsStore);
|
|||||||
<logo v-if="sidebarLogo" :collapse="!appStore.sidebar.opened" />
|
<logo v-if="sidebarLogo" :collapse="!appStore.sidebar.opened" />
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-menu
|
<el-menu
|
||||||
|
:default-active="currRoute.path"
|
||||||
:collapse="!appStore.sidebar.opened"
|
:collapse="!appStore.sidebar.opened"
|
||||||
:background-color="variables.menuBg"
|
:background-color="variables.menuBg"
|
||||||
:text-color="variables.menuText"
|
:text-color="variables.menuText"
|
||||||
|
|||||||
Reference in New Issue
Block a user