]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix(link): use flush post in devtools watcher
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 25 Mar 2021 13:39:41 +0000 (14:39 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 25 Mar 2021 13:39:41 +0000 (14:39 +0100)
Fix #845

src/RouterLink.ts

index ddd8f81ec2a4a0566e2e32de89c083047e3b42db..bea7365b7c1dbb0225f4c392b62c488a6f6e398a 100644 (file)
@@ -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 () => {