Vue-router: Register router-link and router-view with PascalCase for style guide compatibility

Created on 26 Sep 2018  ·  3Comments  ·  Source: vuejs/vue-router

What problem does this feature solve?

The Vue style guide recommends using PascalCase for Vue components in templates. However, since the components are registerd using kebab-case, you can't use PascalCase in the templates:

  Vue.component('router-view', View);
  Vue.component('router-link', Link);

In contrast, they're registered with kebab-case, you'd be able to use them with either kebab-case, or PascalCase:

  Vue.component('RouterView', View);
  Vue.component('RouterLink', Link);

This is the related style guide recommendation: https://vuejs.org/v2/style-guide/#Component-name-casing-in-templates-strongly-recommended

What does the proposed API look like?

<RouterView/>
<RouterLink to="/foo">Go to Foo</RouterLink>

Most helpful comment

This is already fixed, will be released soon

All 3 comments

This is already fixed, will be released soon

Is this released yet? Any expected date?!

This has been released and works really well with templates, thanks for that!!

Unfortunately, the PascalCase version doesn't seem to work with JSX/render functions 🙁

Was this page helpful?
0 / 5 - 0 ratings