VUE路由报错 Cannot read property '$createElement' of undefined

VUE路由报错  Cannot read property '$createElement' of undefined

/*new Vue({

el: '#app',  // 用了路由后就先不用这种方式 用.$mount("#app")

components: { App },  //用了路由后这个也不用了

template: ''  //用了路由后为不让他直接进入App里面  我们给的是路由的地址 用的是es6的语法 我们可以直接使用标签而不用拼接

})*/


//设置路由

const router =new VueRouter({

mode:'history',

base:__dirname,

routes:[

{path:"/",components:User},// 执行到User.vue的页面

    {path:"/Test",components:Test}// 执行到Test.vue的页面

    ]

})


仔细观察后 发现我用的

{path:"/",components:User},// 执行到User.vue的页面

    {path:"/Test",components:Test}// 执行到Test.vue的页面

所以直接 去掉s就好了

{path:"/",component:User},// 执行到User.vue的页面

    {path:"/Test",component:Test}// 执行到Test.vue的页面

你可能感兴趣的:(VUE路由报错 Cannot read property '$createElement' of undefined)