Why the this in the request callback of axios does not point to Vue?

in fact, I would like to ask js under what circumstances will it change the direction of this? Is there anything other than bind,apply?

Mar.18,2021

axios is an independent library, which has nothing to do with any framework / library, so why bind to Vue .

in addition to bind apply,call , which can be this each time a function is called, and some methods, such as Array.prototype.map , can set this

of callback through the last parameter.

otherwise this all point to the object calling the function


this points to the object that calls him.


suggest taking a look at the scope


do you want to ask whether the this in the axios request callback points to the question

Menu