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.push() doesn't update query when provided name route doesn't change #1690

Closed
posva opened this issue Aug 17, 2017 · 2 comments
Closed

Comments

@posva
Copy link
Member

posva commented Aug 17, 2017

from #1182 @kvdmolen

Version

2.7.0

Reproduction link

http://jsfiddle.net/ub9e33fm/12

Steps to reproduce

  1. Click first link (?q=foo)
  2. Click second link (?=foo,bar)

What is expected?

$route.query should update

What is actually happening?

It only updates after another navigation

@posva posva added the bug label Aug 17, 2017
@fnlctrl
Copy link
Member

fnlctrl commented Sep 14, 2017

Quick workaround: Use a fresh array (this.arr.slice()) when using .push()
http://jsfiddle.net/ydwmmum6/

@posva posva changed the title router.push() doesn't update query when providing name route doesn't change router.push() doesn't update query when provided name route doesn't change Sep 15, 2017
@vuejs vuejs deleted a comment from anishdcruz Sep 15, 2017
@vuejs vuejs deleted a comment from lbineau Sep 15, 2017
@vuejs vuejs deleted a comment from Ashishdce Sep 15, 2017
@posva posva added the docs label Oct 8, 2017
@posva
Copy link
Member Author

posva commented Oct 8, 2017

Actually, I don't know why I marked this as a bug... If the array is the same, it's normal for the router not being able to tell it's a different location. To fix it we could compare the JSON representation (which could be very slow) or copy the arrays in queries which can also be slow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants