Skip to content

Commit 4108814

Browse files
committed
fix(link): use flush post in devtools watcher
Fix vuejs#845
1 parent dd8bf6c commit 4108814

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/RouterLink.ts

+15-9
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,21 @@ export const RouterLinkImpl = /*#__PURE__*/ defineComponent({
169169

170170
if ((__DEV__ || __FEATURE_PROD_DEVTOOLS__) && __BROWSER__) {
171171
const instance = getCurrentInstance()
172-
watchEffect(() => {
173-
if (!instance) return
174-
;(instance as any).__vrl_route = link.route
175-
})
176-
watchEffect(() => {
177-
if (!instance) return
178-
;(instance as any).__vrl_active = link.isActive
179-
;(instance as any).__vrl_exactActive = link.isExactActive
180-
})
172+
watchEffect(
173+
() => {
174+
if (!instance) return
175+
;(instance as any).__vrl_route = link.route
176+
},
177+
{ flush: 'post' }
178+
)
179+
watchEffect(
180+
() => {
181+
if (!instance) return
182+
;(instance as any).__vrl_active = link.isActive
183+
;(instance as any).__vrl_exactActive = link.isExactActive
184+
},
185+
{ flush: 'post' }
186+
)
181187
}
182188

183189
return () => {

0 commit comments

Comments
 (0)