[Vuejs]-Vue.js router init works with router.map not with the Router constructor

0👍

Currently there are 2 versions of Vue Router.

1st – Vue Router 0.7.x which only works with VueJS 1.x.x version.The working example you posted is Vue Router 0.7.x version syntax, so probably you are running VueJS 1.x.x on your app.

2nd – Vue Router 2.x which only works with VueJS 2.x.x.The second non-working examplte is Vue Router 2.x version syntax.

So make sure what VueJS version you are running, and then apply correct Vue Router Version, and use correct syntax.

Docs for Vue Router 2.x.xhttps://router.vuejs.org/en/
Docs for Vue Router 0.7.xhttps://github.com/vuejs/vue-router/tree/1.0/docs/en

Leave a comment