core icon indicating copy to clipboard operation
core copied to clipboard

[Bug report] does not highlight the anchor link

Open Arhell opened this issue 1 year ago • 2 comments

Description

When I go to the document everything works 1

When you copy the link in a line and open it in a new tab, it doesn’t work https://vuepress.github.io/guide/getting-started.html#try-it-online 2

Reproduction

https://vuepress.github.io/guide/getting-started.html#try-it-online

Used Package Manager

npm

System Info

official documentation
https://vuepress.github.io/guide/getting-started.html#try-it-online

Arhell avatar Mar 11 '24 16:03 Arhell

@meteorlxy cc

Mister-Hope avatar Mar 19 '24 13:03 Mister-Hope

The issue is about <RouteLink>

When the page is rendered during ssr, no hash is on route path, the computed active state is false, so <RouteLink> won't be active in SSR result.

When a path is visited with hash, the correct <RouteLink> will be active, and the computed state will be true. No rerender will be triggered by Vue, instead an SSR mismatch warning is outputed.

I think we'd better track how the original <RouterLink> solves this problem.

Mister-Hope avatar Mar 25 '24 05:03 Mister-Hope