首页 > 移动平台 > 详细

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

时间:2019-11-02 14:51:27      阅读:207      评论:0      收藏:0      [点我收藏+]
 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 的解决办法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!