router-extras-module icon indicating copy to clipboard operation
router-extras-module copied to clipboard

[Feature request] displayName aside of name

Open ozooxo opened this issue 5 years ago • 4 comments

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!

ozooxo avatar Jan 28 '20 12:01 ozooxo

Hi @ozooxo

I am not sure to understand the need of multiple pages with the same name.

Could you give us a concrete example?

atinux avatar Oct 03 '20 10:10 atinux

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.

ozooxo avatar Oct 09 '20 13:10 ozooxo

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.

Denoder avatar Dec 04 '20 14:12 Denoder

never mind on this, i can just utilize the meta field for this.

Denoder avatar Dec 05 '20 20:12 Denoder