-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
router.resolve does not use current route by default #2385
Closed
decademoon opened this issue
Sep 14, 2018
· 3 comments
· Fixed by mariazevedo88/hash-generator-js#5, tghelere/valorize-vidas#4, tghelere/DeliVuery#18, tghelere/dailymages#2 or tghelere/vuestore#4
Closed
router.resolve does not use current route by default #2385
decademoon opened this issue
Sep 14, 2018
· 3 comments
· Fixed by mariazevedo88/hash-generator-js#5, tghelere/valorize-vidas#4, tghelere/DeliVuery#18, tghelere/dailymages#2 or tghelere/vuestore#4
Comments
In current implementation, this is how the resolve method is implemented https://github.com/vuejs/vue-router/blob/dev/src/index.js#L177 : resolve (
to: RawLocation,
current?: Route,
append?: boolean
): {
location: Location,
route: Route,
href: string,
// for backwards compat
normalizedTo: Location,
resolved: Route
} {
const location = normalizeLocation(
to,
current || this.history.current,
append,
this
)
const route = this.match(location, current)
const fullPath = route.redirectedFrom || route.fullPath
const base = this.history.base
const href = createHref(base, fullPath, this.mode)
return {
location,
route,
href,
// for backwards compat
normalizedTo: location,
resolved: route
}
} I am thinking the issue is coming from from line 195: I am proposing this new implementation: resolve (
to: RawLocation,
current?: Route,
append?: boolean
): {
location: Location,
route: Route,
href: string,
// for backwards compat
normalizedTo: Location,
resolved: Route
} {
current = current || this.history.current
const location = normalizeLocation(
to,
current,
append,
this
)
const route = this.match(location, current)
const fullPath = route.redirectedFrom || route.fullPath
const base = this.history.base
const href = createHref(base, fullPath, this.mode)
return {
location,
route,
href,
// for backwards compat
normalizedTo: location,
resolved: route
}
} Will love to receive feedbacks.. |
posva
added a commit
that referenced
this issue
Sep 16, 2018
yeah, I remember I did this but somehow never committed the code nor created a PR... |
Thanks :) |
posva
added a commit
that referenced
this issue
Mar 23, 2019
posva
added a commit
that referenced
this issue
Mar 28, 2019
posva
added a commit
that referenced
this issue
Mar 28, 2019
Fixes #2385 <!-- Please make sure to read the Pull Request Guidelines: https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines -->
This was referenced Aug 29, 2019
This was referenced Oct 26, 2019
This was referenced Jan 20, 2020
This was referenced Feb 6, 2020
[Snyk] Upgrade vue-router from 3.0.1 to 3.1.4
michaelwybraniec/vue-vuex-jwt-authentication-example#2
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
3.0.1
Reproduction link
http://jsfiddle.net/df4Lnuw6/698/
Steps to reproduce
What is expected?
No warning to be shown.
What is actually happening?
A warning is shown saying that the id param was not provided. The docs mention that the current route will be used if omitted.
The text was updated successfully, but these errors were encountered: