You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I have the following router setup:
router.map({
'/a/:a': {
name: 'a',
component: ComponentA,
subRoutes: {
'/b/:b': {
name: 'b',
component: ComponentB,
}
}
}
})
and the following HTML for ComponentA:
<a v-link="{ name: 'b', params: { b: 'banana' } }">Go to B</a>
then if I am at the address /a/apple and I click the link, I will end up at /a/undefined/b/banana. Why isn't the a param inherited from the current params? Is this intentional?
Am I supposed to do this instead:
<a v-link="{ name: 'b', params: { a: $route.params.a, b: 'banana' } }">Go to B</a>
but surely that will get messy real quick, especially if there are lots of params.
However, in the new version this behavior is no longer available, and attempting to define a link with incomplete params throws an error during link render from fillParams.
I'm the OP of that forum post, and now that I'm upgrading to Vue 2 I have the same problem again. I have lots of links, so this will be a pain to make work.
Basically as described in
http://archive.forum.vuejs.org/topic/1254/how-to-inherit-route-params-with-v-link
However, in the new version this behavior is no longer available, and attempting to define a link with incomplete params throws an error during link render from fillParams.
This was fixed in version v0.7.8 by https://github.com/vuejs/vue-router/blob/1.0/src/route.js#L25
Was there a good reason this behavior was removed? Can it be re-added?
The text was updated successfully, but these errors were encountered: