首页 > Web开发 > 详细

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

时间:2017-12-29 11:02:34      阅读:341      评论:0      收藏:0      [点我收藏+]

错误:

技术分享图片

解决办法:

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的时候,再写篇解决办法。。。

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

原文:https://www.cnblogs.com/zr123/p/8142981.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!