router-extras-module
router-extras-module copied to clipboard
[Feature request] displayName aside of name
Is it possible to define
<router>
{
name: 'my unique customized name',
displayName: 'My Display Name'
}
</router>
as by using name I cannot have duplicated names? Imaging that I have multiple pages name "settings" for various different proposes, when I am generating a navigation bar I have no need to specify them (as what setting it belongs to can be found from the other part of the navigation bar). However, if I call all of them "settings" I'll get an error:
WARN [vue-router] Duplicate named routes definition: { name: "Settings", path: "/path/to/some/settings" }
and potentially I may confuse nuxt in <nuxt-link>
block if I use name.
Thanks!
Hi @ozooxo
I am not sure to understand the need of multiple pages with the same name.
Could you give us a concrete example?
Yup.
So imaging that I have a hierarchical structure set of pages which includes my_repo > settings
and my_user_account > settings
. When I am displaying I want my_repo
and my_user_account
to point to the parent page, and the child page should only names as settings
as it is obvious the settings belong to whom. However, by doing so I got a name conflict because both pages are named settings
.
I also agree with this because when using the i18n-module, the named route gets changed to something like namedRoute__en
depending on the current language.
never mind on this, i can just utilize the meta field for this.