【发布时间】:2017-01-20 15:31:30
【问题描述】:
我正在尝试从位于localhost:3000 的服务器获取对象。当我转到浏览器中的地址时,我可以看到该对象。
我的前端运行在我的Vue 实例的methods 属性中定义的这个函数:
goToTutors: function(){
this.step='tutors';
this.$http.get('http://localhost:3000/tutors').then(
function(tutors) {
console.log("Tutors found!");
},
function(error) {
console.log(error);
});
}
但在我的浏览器控制台中,我看到的只是错误:
Uncaught TypeError: _.isArray is not a function at vue-resource.js:172
谁能指出错误的原因?
【问题讨论】:
-
看起来 vue-resource 正在寻找
lodash(_.isArray 是一种 lodash 方法)但找不到。尝试将其添加到您的页面。
标签: node.js vue.js vue-resource