diff --git a/src/layout/components/sidebar/horizontal.vue b/src/layout/components/sidebar/horizontal.vue index 32f2951f6..b252e4bcc 100644 --- a/src/layout/components/sidebar/horizontal.vue +++ b/src/layout/components/sidebar/horizontal.vue @@ -47,6 +47,13 @@ watch( } ); +watch( + () => route.path, + () => { + menuSelect(route.path, routers); + } +); + function translationCh() { instance.locale = { locale: "zh" }; locale.value = "zh"; diff --git a/src/layout/components/sidebar/vertical.vue b/src/layout/components/sidebar/vertical.vue index bdef950a2..94b81085c 100644 --- a/src/layout/components/sidebar/vertical.vue +++ b/src/layout/components/sidebar/vertical.vue @@ -51,6 +51,7 @@ watch( () => route.path, () => { getSubMenuData(route.path); + menuSelect(route.path, routers); } );