Which VueJS lifecycle hook must Asynchronous HTTP requests be called in? Which VueJS lifecycle hook must Asynchronous HTTP requests be called in? vue.js vue.js

Which VueJS lifecycle hook must Asynchronous HTTP requests be called in?


TL;DR in the general (and safe) case, use created().

Vue's initialization code is executed synchronously.

Technically, any ASYNChronous code you run in beforeCreate(), created(), beforeMount() will only respond after all of those hooks finish. See demo: