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

fix(router): check $router.beforeEach exists before using #20549

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

sgpinkus
Copy link
Contributor

@sgpinkus sgpinkus commented Oct 3, 2024

Make use of $router global safer.

Code breaks if something that isn't a vue-router inhabits the global Vue var "$router". For example, I'm using a different router and it installed itself to the global name "$router" but it doesn't have a beforeEach method. I don't think "$router" has been reserved specifically for vue-router or any router implementation.

Description

Markup:

@MajesticPotatoe MajesticPotatoe added T: bug Functionality that does not work as intended/expected E: router labels Oct 28, 2024
@MajesticPotatoe MajesticPotatoe changed the title Check $router.beforeEach exists before using since $router may not be a vue-router fix(router): Check $router.beforeEach exists before using since $router Oct 28, 2024
@johnleider johnleider added this to the v3.7.x milestone Jan 24, 2025
@johnleider johnleider changed the title fix(router): Check $router.beforeEach exists before using since $router fix(router): check $router.beforeEach exists before using Jan 24, 2025
@johnleider johnleider merged commit bcce042 into vuetifyjs:master Jan 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E: router T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants