Uncaught (in promise) TypeError: Cannot read property 'result' of undefined
_this.productList = res.body.result.list;报错,Uncaught (in promise) TypeError: Cannot read property 'result' of undefined,请问是怎么回事
完整代码如下:
var vm = new Vue({
el:"#app",
data:{
totalMoney:0,
productList:[]
},
filters:{
},
mounted:function(){
this.$nextTick(function(){
this.cartView();
})
},
methods:{
cartView:function(){
var _this = this;
this.$http.get("data/cartData.json",{"id":123}).then(function(res){
_this.productList = res.body.result.list;
_this.totalMoney = res.body.result.totalMoney;
});
}
}
});