【发布时间】:2017-06-21 17:42:29
【问题描述】:
我有一个请求要获取一些数据并将其添加到变量中,
当我使用时:
.then(function(response) {
this.persons = response.data;
});
它不会将response.data 分配给this.persons,但是当我执行以下操作时:
.then(response => this.persons = response.data);
它可以很好地使用它。请看js小提琴:
【问题讨论】: