Would like to be able to use <RouterLink> instead of <router-link>.
Reason for this is that in the Vue Style Guide PascalCase is recommended and in the latest version of [email protected] this rule is now auto-fixable (e.g. it will convert <router-link> into <RouterLink>) but this breaks and the link does not work. https://vuejs.org/v2/style-guide/#Component-name-casing-in-templates-strongly-recommended
We have gotten around the issue by re-defining the router components like so:
const RouterView = Vue.component('router-view');
const RouterLink = Vue.component('router-link');
Vue.component('RouterView', RouterView);
Vue.component('RouterLink', RouterLink);
Update component definition in vue-router to have both PascalCase and kebab-case:
Vue.component('router-view', View);
Vue.component('RouterView', View);
Vue.component('router-link', Link);
Vue.component('RouterLink', Link);
This is done but not released yet :)
Okay great, thanks for the update @posva. Do you know when this will be released or a link to a PR so I can follow along?
watch the repo for releases
Wow there hasn't been a release in like 10 months, is there anything I can do to help speed up the process?
For anyone else that finds this, it looks like this commit from Oct 24 in 2017 (10 months ago) is the one https://github.com/vuejs/vue-router/commit/f9585651dbcede28a3a48c47abad3200f655d776.
@posva the changes you have made seem to be in now, however the main file (from package.json) is still outputting the kebab-case version as the component name. I think this is why you still cannot use PascalCase :( - https://github.com/vuejs/vue-router/blob/dev/dist/vue-router.common.js
@posva just cloned the repo locally and ran npm run build and got the expected outcome in the vue-router.common.js
Most helpful comment
This is done but not released yet :)