fix(vue): incorrect view rendered when using router.go(-n) - #29847
Closed
xxllxhdj wants to merge 1 commit into
Closed
fix(vue): incorrect view rendered when using router.go(-n) #29847xxllxhdj wants to merge 1 commit into
xxllxhdj wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
2 tasks
Contributor
|
Thank you for submitting the PR! This PR will be closed in favor of #29877. You were given co-author credit in the other PR. |
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Oct 22, 2024
resolves #28201 This PR fixes the navigation issue related to `router.go` that was identified in issue #28201. After working on this issue I realised that @xxllxhdj has already created a PR for this in #29847. While their fix is great, I have added tests to replicate the issue, reused existing code and `undefined` will be returned in unexpected situations - which matches the existing functionality. ## What is the current behavior? If a user navigates from `/home` -> `/pageA` -> `/pageB` -> `/pageC` -> back to `/pageB` -> then `router.go(-2)` is called the URL will be updated to `/home` correctly, but the app will try to render `/pageA`. This happens for any delta < -1. ## What is the new behavior? The app will correctly render `/pageA`, which matches the URL. ## Does this introduce a breaking change? - [ ] Yes - [X] No --------- Co-authored-by: xxllxhdj <12881488+xxllxhdj@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue number: resolves #28201
What is the current behavior?
Say you have the following application history:
/pageA-->/pageB-->/pageC-->/pageD--> back to/pageCIf you were to call router.go(-2) on
/pageC, you would be brought back to/pageB. But the address in the browser address bar is correct.What is the new behavior?
In above case, if you were to call router.go(-2) on
/pageC, you would be brought back to/pageA.Does this introduce a breaking change?
Other information