错误:

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

解决办法:

2.0已经没有map了,使用npm install [email protected] 命令兼容1.0版本vue

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

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

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

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

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

04-17 07:53