Alternatively nuxt vue, axios how to send multiple requests

In use vue or nuxt, we need to use axios to send multiple http requests, reference is made to the official description axios you might think of using axios.all send the request, but this may be some exception error:

(node:9360) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: __WEBPACK_IMPORTED_MODULE_2__plugins_axios__.a.all is not a function

Therefore, the correct posture is the use of use Promise.allto send multiple requests refer to specific implementation implemented as follows:

Heap Stack Blog(pingbook.top)Nuxt How to send multiple requests in asyncData

Guess you like

Origin www.cnblogs.com/alterhu/p/11580691.html