Skip to content

implicit params ({ name: 'sub-route' }) don't update when navigating between nested routes #2121

New issue

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

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

Already on GitHub? # to your account

Comments

@mudoo
Copy link

mudoo commented Mar 22, 2018

Version

3.0.1

Reproduction link

https://jsfiddle.net/67xnq5to/

Steps to reproduce

  1. click /foo/1/sub1
  2. click /foo/2/sub1
  3. click sub2

What is expected?

id==2

What is actually happening?

id is 1

like #1255

@mudoo mudoo changed the title dynamically params can't update <router-link> dynamically params can't update Mar 22, 2018
@posva

This comment has been minimized.

@posva posva added the bug label Mar 23, 2018
@posva posva changed the title <router-link> dynamically params can't update implicit params ({ name: 'sub-route' }) don't update when navigating between nested routes Mar 23, 2018
@reinhardt1053
Copy link

Any workaround?

@posva
Copy link
Member

posva commented Jul 2, 2018

@reinhardt1053 The workaround is explicitly passing the param:

const FooSub1 = {
  template: '<router-link :to="{name:\'sub2\', params: { id: $route.params.id}}">sub2</router-link>'
}

Sorry for the delay 😅

@jesusfreak3

This comment has been minimized.

@rlfrahm
Copy link

rlfrahm commented Aug 25, 2018

Checkout this comment which mighttttt be your problem? #1255 (comment)

@econic

This comment has been minimized.

@posva

This comment has been minimized.

posva added a commit that referenced this issue Mar 28, 2019
* fix(normalizeLocation): create a copy with non normalized named locations

Fix #2121

* test(nested-routes): add e2e test for implicit params

* chore(lint): fix
# for free to join this conversation on GitHub. Already have an account? # to comment