diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index 3fd5593eae2fee7fe5e91f06daed5a41006f836e..84e27e5cc0f718f967a4cb6d82b69735d35a6031 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -31,7 +31,6 @@ import { RouteRecordRaw } from 'vue-router'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const route = useRoute(); const appStore = useAppStore(); const settingsStore = useSettingsStore(); const permissionStore = usePermissionStore(); @@ -42,7 +41,7 @@ const theme = computed(() => settingsStore.theme); const isCollapse = computed(() => !appStore.sidebar.opened); const activeMenu = computed(() => { - const { meta, path } = route; + const { meta, path } = useRoute(); // if set path, the sidebar will highlight the path you set if (meta.activeMenu) { return meta.activeMenu;