Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] routeLocale and route.path will be triggered unexpected. #1252

Closed
Mister-Hope opened this issue Feb 5, 2023 · 2 comments · Fixed by #1253
Closed

[Bug report] routeLocale and route.path will be triggered unexpected. #1252

Mister-Hope opened this issue Feb 5, 2023 · 2 comments · Fixed by #1253
Labels
bug Something isn't working

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented Feb 5, 2023

Description

const routeLocale = useRouteLocale();
const route = useRoute()

// triggers while scrolling pages
watchEffect(() => {
   console.log("routelocale update");

   routeLocale.value;
 });

watchEffect(() => {
   console.log("route path update");

   route.path;
 });

Route locale and route path update will be triggered while scrolling page (with hash and query change) .

This will have performance impact as we are expecting that routeLocale remain unchanged unless we navigate to a new locale and route.path not changed unless we navigate to a new page.

Reproduction

https://v2.vuepress.vuejs.org/

Used Package Manager

npm

System Info

Not needed
@Mister-Hope Mister-Hope added the bug Something isn't working label Feb 5, 2023
@Mister-Hope
Copy link
Member Author

Related discussion vuejs/router#1687

@Mister-Hope Mister-Hope changed the title [Bug report] routeLocale will be triggered unexpected. [Bug report] routeLocale and route.path will be triggered unexpected. Feb 5, 2023
@Mister-Hope Mister-Hope linked a pull request Feb 7, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant