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

[rewrite:core router] in non-hash mode, anchor-based navigation triggers the router resolution logic #1270

Closed
pygy opened this issue Aug 24, 2016 · 4 comments

Comments

@pygy
Copy link
Member

pygy commented Aug 24, 2016

Setting the hash of the location triggers onpopsate which triggers the route resolution logic.

It means that if someone wants to use local anchors in a page/app, they'll have to take that quirk into account...

A partial solution would be to set a flag to true when setPath() is called and skip resolution in non-hash mode when it hasn't been set... But it probably breaks the back button, so it isn't satisfactory...

@pygy pygy changed the title [rewrite:coreRouter] in non-hash mode, anchor-based navigation triggers the router resolution logic [rewrite:core router] in non-hash mode, anchor-based navigation triggers the router resolution logic Aug 25, 2016
@lhorie
Copy link
Member

lhorie commented Dec 1, 2016

I think it should trigger it in that case, since hash can have route parameters and you'd want a redraw if they changed

@lhorie lhorie closed this as completed Dec 1, 2016
@pygy
Copy link
Member Author

pygy commented Dec 1, 2016

So, in non-hash mode, the router will parse parameters that happen after the pound sign?

Routing to /foo#bar?baz=qux should populate vnode.attrs with baz: 'qux'? That sounds very backwards to me...

@lhorie
Copy link
Member

lhorie commented Dec 1, 2016

@pygy that specific case wouldn't work as expected, because query is supposed to comes before hash. /foo?a=1#b=2 yields {a: 1, b: 2} though.

@pygy
Copy link
Member Author

pygy commented Dec 1, 2016

In what scenario would you want to do that rather than /foo?a=1&b=2? Do you rely on it?

It looks like an exotic use case compared to having anchors that work without triggering routing.

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

No branches or pull requests

3 participants