From a97c4d1dc028d824336e1aed5599932f57f37b32 Mon Sep 17 00:00:00 2001 From: pdsuwwz Date: Wed, 21 Jun 2023 01:30:00 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20leave=20work=20platform?= =?UTF-8?q?=20watch=20route?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widgets/WorkMenu/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widgets/WorkMenu/index.vue b/src/widgets/WorkMenu/index.vue index b11ae9c..b39ee3a 100644 --- a/src/widgets/WorkMenu/index.vue +++ b/src/widgets/WorkMenu/index.vue @@ -28,7 +28,6 @@ const menuOptions = shallowRef( const activeKey = ref(null) const refMenu = ref() -console.log(refMenu) let lockPush = false const handleSelect = (key: string) => { @@ -105,8 +104,11 @@ const setActiveKey = async (key: string) => { watch( () => route.fullPath, - () => { - if (lockPush) return + (newRoute) => { + if ( + lockPush || + !newRoute.includes('/work-platform') // 防止离开工作台后会继续 watch + ) return const targetRoute = recursion(menuOptions.value, route.name, { id: 'key', @@ -144,8 +146,6 @@ watch( } ) - -