You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to add a view transition effect to the article links on the homepage recently, I saw such a display effect.
bug_report.mp4
When I first clicked on the article link, the transition effect displayed normally. After clicking the same article link a second time, could see the article flicker for a moment.
Reproduction
The link below is my relevant code, which is very simple, containing only a template for an "a" link, and then there is a click event listener that executes a transition effect upon clicking.
I attempted to intercept this event by using the capture and stopImmediatePropagation functions, but due to the timing of the setup being relatively late, it was not possible to achieve this. When I replaced the a link with button, this bug no longer occurred.
Expected behavior
I hope to adjust the hierarchy of this listener so that users can customize link jump behavior.
Describe the bug
I've been trying to add a view transition effect to the article links on the homepage recently, I saw such a display effect.
bug_report.mp4
When I first clicked on the article link, the transition effect displayed normally. After clicking the same article link a second time, could see the article flicker for a moment.
Reproduction
The link below is my relevant code, which is very simple, containing only a template for an "a" link, and then there is a click event listener that executes a transition effect upon clicking.
https://github.com/shellRaining/blog/blob/main/theme/Home/PostItem.vue
After my investigation, I found that an event listener was at too high a level, preventing me from intercepting its actions.
vitepress/src/client/app/router.ts
Lines 174 to 239 in 8f31a4c
I attempted to intercept this event by using the
capture
andstopImmediatePropagation
functions, but due to the timing of the setup being relatively late, it was not possible to achieve this. When I replaced thea
link withbutton
, this bug no longer occurred.Expected behavior
I hope to adjust the hierarchy of this listener so that users can customize link jump behavior.
System Info
Additional context
Is there any other way to solve this problem? I once wanted to use
onBeforeRouteChange
hook, but seems not suit my requirement.Validations
The text was updated successfully, but these errors were encountered: