52,797
社区成员
发帖
与我相关
我的任务
分享
// 不同function中。 this 指向变了
var self = this; // 保存this引用
this.$ajax({
...
}).then(function(response) {
self.data1 = response.data;
});
// 如果可以用箭关函数,则没有这问题
this.$ajax({
...
}).then((response) => {
this.data1 = response.data;
});