详解Vue.js搭建路由报错 router.map is not a function
2017-06-27 11:50
1416 查看
错误:
出现问题原因:2.0已经没有map这个方法了,只有1.0兼容该方法。
解决方法:
(1)方法1:使用命令npm install vue-router@0.7.13兼容1.0版本vue。
在代码中的使用方法:
(2)解决方法2:基于vue2.0,写对应的方法。
具体用法如下图:
注:1.0和2.0在一些用法上有比较大的差别,用的时候需要注意。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- Vue.js搭建路由报错 router.map is not a function,Cannot read property ‘component’ of undefined
- Vue.js搭建路由报错 router.map is not a function,Cannot read property ‘component’ of undefined
- Vue.js搭建路由报错 router.map is not a function
- Vue.js搭建路由报错 router.map is not a function
- Vue.js路由vue-router使用方法详解
- Vue.js路由组件vue-router使用方法详解
- js错误Uncaught TypeError: $(...).datagrid is not a function自己写的并没有错但是一直报这个错(详解)
- ajaxfileupload.js jQuery.handleError is not a function
- cocos2d js 编译jsc 报错this._super is not a function
- js提交表单错误:document.form.submit() is not a function
- ajaxfileupload.js结合低版本jquery报异常:TypeError: jQuery.handleError is not a function
- 当js中出现 a() is not a function
- JS-”Undefined is not a function“错误
- js中遇到问题 *** is not a function
- jquery.form.js关于$("form").ajaxSubmit is not a function原因 .
- JS-underfined is not a function
- js报错:TypeError: document.GetElementById is not a function
- js 报错:object is not a function
- Sea.js出现Uncaught TypeError: object is not a function的解决方法
- js报错 object is not a function