undefinedfix
Sign in

Vue then operation questions

user846566 edited in Tue, 11 May 2021
}).then(function (response) {
   return response.json();
}).then(function (response) {
   _this.error = false;
   _this.page++;
   
   
请问下这里的两个then分别表示什么意思,为啥不放在同一个then里面呢?
3 Replies
laerni_oke
commented on Tue, 11 May 2021

The first then is to JSON the return value, and the second then is to complete the specific business through the return value

I think this may be due to the separation of logic. Similar to the combination of functions, the input and output of each function is fixed, which is also convenient for later modification.

DACBARBOS
commented on Tue, 11 May 2021

This should be the chaining operation of ES6 functions. If you're right, you should use asiox. Can go familiar with the arrow function, and functional chain call, and then to understand what you said

Amer
commented on Tue, 11 May 2021

Click here

lock This question has been locked and the reply function has been disabled.