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

<router-link> component is mutating a prop #2938

Closed
antonyme opened this issue Sep 20, 2019 · 4 comments

Comments

@antonyme
Copy link

commented Sep 20, 2019

Version

2.6.0

Reproduction link

https://codesandbox.io/embed/vue-template-hf9hq

Steps to reproduce

  • Click on 'route' link
  • Look at the console

What is expected?

In components/Parent.vue the object childRoute, that is passed as the to prop of <router-link>, should not be mutated.

What is actually happening?

It is mutated (the key parent is added to childRoute.params)

@posva

This comment has been minimized.

Copy link
Member

commented Sep 20, 2019

I haven't checked but there is a chance that the problem comes from router.resolve or a normalization function

@zrh122

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2019

Maybe PR #2802 can fix it, but the test code in the PR is not for this issue. @posva

I have found this issue when i try to fix #2800, and this comment mention it. But i didn't add new issuse for it.

@posva

This comment has been minimized.

Copy link
Member

commented Sep 23, 2019

I completely forgot about that PR, thank you @zrh122 ! I will take another look

@posva posva added the has PR label Sep 23, 2019
posva added a commit to zrh122/vue-router that referenced this issue Sep 23, 2019
posva added a commit that referenced this issue Sep 23, 2019
Closes #2800, #2938 

* fix(normalizeLocation): add a copy for params with named locations

* test: add test case for #2938
@posva

This comment has been minimized.

Copy link
Member

commented Sep 23, 2019

Closed in #2802

@posva posva closed this Sep 23, 2019
@posva posva added this to Done in Longterm Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.