Vue.js搭建路由报错 router.map is not a function,Cannot read property ‘component’ of undefined

错误:

解决办法:

2.0已经没有map了,使用npm install vue-router@0.7.13 命令兼容1.0版本vue

但是安装完之后会出现一个错误: Cannot read property ‘component’ of undefined

看到了一个解决办法:npm install vue-router@next; 就能解决问题。

但是我做了;还是 Cannot read property ‘component’ of undefined;我的理解是vue已经到2了;不能用1的vue-router了。

等我将router改为2的时候,再写篇解决办法。。。

posted @ 2017-12-29 10:01  web小白需努力  阅读(697)  评论(0编辑  收藏  举报