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

to parameter overly verbose when you have params #2952

Closed
oppianmatt opened this issue Oct 2, 2019 · 1 comment
Closed

to parameter overly verbose when you have params #2952

oppianmatt opened this issue Oct 2, 2019 · 1 comment

Comments

@oppianmatt
Copy link

What problem does this feature solve?

Using the to parameter is overly verbose for example:

<router-link :to="{ name: 'user', params: { userId: 123 }}">User</router-link>

What does the proposed API look like?

Would be better to move some of the fields as props so you could have:

<router-link to="user" :params="{ userId: 123 }">User123</router-link>

This seems more natural to use. The first version I find I have to lookup the syntax each time, it's not obvious.

It's also a more natural progression for learning. For example you start with the basic:

<router-link to="/foo">Go to Foo</router-link>

And then to add a param you just add the param prop:

<router-link to="/foo" :params="{bar:123}">Go to Foo</router-link>

It's much easier for end users to learn and adopt. It's more obvious and straight forward. It's also backwards compatible (in that you just don't use the new props and the old way works also).

@posva
Copy link
Member

posva commented Oct 2, 2019

Duplicate of #2818

@posva posva marked this as a duplicate of #2818 Oct 2, 2019
@posva posva closed this as completed Oct 2, 2019
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

2 participants