Delete' Axios ' does not need to use Vue.use () to have the install method in Vue, the use method is required to return a Promise object when Vue is using Axios. You can use the. Then method in the data of the component to define a container to receive data, and then use this when mounted. The data container name to receive the data received by Axios.
Alternatively, you can use Stroe in Vuex to receive this data and then use this in this component by using the Vuex method mapstate and so on where you need to use it. $stroe way to use the stored data. Data sharing is realized. The implementation of loading is based on the action performed before the request to the page Ajax is successful, and the default loading effect then changes the state of the loading after the request succeeds. // The cache is generally called when the cache is processed more than 500 milliseconds using caching.
We can use the loading method to mount a method in the instance of Vue, such as vue.prototype.loading={}, and then use it on a global basis.
Axios plug-ins and loading implementations