From: Eduardo San Martin Morote Date: Thu, 25 Mar 2021 13:39:41 +0000 (+0100) Subject: fix(link): use flush post in devtools watcher X-Git-Tag: v4.0.6~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=41088143c62244fe7b198e0907f4f6f98852df62;p=thirdparty%2Fvuejs%2Frouter.git fix(link): use flush post in devtools watcher Fix #845 --- diff --git a/src/RouterLink.ts b/src/RouterLink.ts index ddd8f81e..bea7365b 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 () => {