码迷,mamicode.com
首页 > 移动开发 > 详细

VUE - 使用axios数据请求时数据绑定时 报错 TypeError: Cannot set property 'xxxx' of undefined 的解决办法

时间:2019-11-02 13:58:20      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:not   ace   rop   data   exe   ora   ack   mono   cdc   

 created() {
    var that=this
    axios.get(‘http://jsonplaceholder.typicode.com/todos‘)
    .then(function (res) {
      // handle success
      // console.log(res);
      that.todos = res.data
    })
    .catch(function (error) {
      // handle error
      console.log(error);
    })
    .finally(function () {
      // always executed
    });
    },
}

 

VUE - 使用axios数据请求时数据绑定时 报错 TypeError: Cannot set property 'xxxx' of undefined 的解决办法

标签:not   ace   rop   data   exe   ora   ack   mono   cdc   

原文地址:https://www.cnblogs.com/500m/p/11781438.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!