-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Open
Labels
feature requestgroup[router-link redesign]Issues regarding a redesign in current router-link implementation to make it make it more customizabIssues regarding a redesign in current router-link implementation to make it make it more customizabneeds RFCThis feature request needs to go through the RFC process to gather more informationThis feature request needs to go through the RFC process to gather more information
Description
What problem does this feature solve?
In my projects, I always link to the routes using route name (and also set it as a standard of my team). e.g.
<router-link :to="{ name: 'productList' }">Product List</router-link>
<router-link :to="{ name: 'productItem', params: { id: 1 }}">Product Detail</router-link>
I found this pattern is unnecessary too long and not convenient to use compare to a much shorter syntax of using route link
<router-link to="/products-list">Product List</router-link>
<router-link to="/products/1">Product Detail</router-link>
Anyway, I still want to use named route everywhere (for the sake of maintainability & scalability) and feel like link to named route can be improved.
What does the proposed API look like?
I want the :to
to be able to link to named route as-is (so when we created a route object somewhere else, we can bind it easily). But maybe you can make another prop for named route, such as:
<router-link toName="productList">Product List</router-link>
<router-link toName="productItem" :params="{ id: 1 }">Product Detail</router-link>
Or (I don't know if it possible) custom modifiers?:
<router-link to.name="productList">Product List</router-link>
<router-link to.name="productItem" :params="{ id: 1 }">Product Detail</router-link>
griest024, dobromir-hristov, xtate, nosedive77, maroon1 and 6 more
Metadata
Metadata
Assignees
Labels
feature requestgroup[router-link redesign]Issues regarding a redesign in current router-link implementation to make it make it more customizabIssues regarding a redesign in current router-link implementation to make it make it more customizabneeds RFCThis feature request needs to go through the RFC process to gather more informationThis feature request needs to go through the RFC process to gather more information