From 41088143c62244fe7b198e0907f4f6f98852df62 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 25 Mar 2021 14:39:41 +0100 Subject: [PATCH] fix(link): use flush post in devtools watcher Fix #845 --- src/RouterLink.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/RouterLink.ts b/src/RouterLink.ts index ddd8f81ec..bea7365b7 100644 --- a/src/RouterLink.ts +++ b/src/RouterLink.ts @@ -169,15 +169,21 @@ export const RouterLinkImpl = /*#__PURE__*/ defineComponent({ if ((__DEV__ || __FEATURE_PROD_DEVTOOLS__) && __BROWSER__) { const instance = getCurrentInstance() - watchEffect(() => { - if (!instance) return - ;(instance as any).__vrl_route = link.route - }) - watchEffect(() => { - if (!instance) return - ;(instance as any).__vrl_active = link.isActive - ;(instance as any).__vrl_exactActive = link.isExactActive - }) + watchEffect( + () => { + if (!instance) return + ;(instance as any).__vrl_route = link.route + }, + { flush: 'post' } + ) + watchEffect( + () => { + if (!instance) return + ;(instance as any).__vrl_active = link.isActive + ;(instance as any).__vrl_exactActive = link.isExactActive + }, + { flush: 'post' } + ) } return () => {