I am trying to implement simple routing with official route library.
Here is my app.js
window.Vue = require('vue');
window.VueRouter= require('vue-router');
Vue.use(VueRouter);
const vt=Vue.component('example', require('./components/Example.vue'));
const router = new VueRouter({
routes:[
{
path:'/test',
component:vt
}
]
})
const app = new Vue({
el: '#app',
router:router
});
But i got an error
app.js:11256 Uncaught TypeError: VueRouter is not a constructor
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire