Skip to content

Commit

Permalink
fix(link): use flush post in devtools watcher
Browse files Browse the repository at this point in the history
Fix #845
  • Loading branch information
posva committed Mar 25, 2021
1 parent dd8bf6c commit 4108814
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/RouterLink.ts
Expand Up @@ -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 () => {
Expand Down

0 comments on commit 4108814

Please sign in to comment.