0👍
If you want to maintain the order, I think Promise.all() is going to be helpful.
Here is how I’d do it:
async created () {
const imageNames = await this.getImageNames();
const imageUrls = await Promise.all(
imageNames.map(imageName => this.getDownloadURL(imageName))
);
console.log(imageUrls)
}
imageNames.map(imageName => this.getDownloadURL(imageName))
will create an array of promises.
The promises will all start at the same time, but will get resolved in the order that they appear.
- [Vuejs]-Two figures in one row using vue-chartjs
- [Vuejs]-"export 'default' " <imported as '__vue_script__'> was not found in '!!babel-loader
Source:stackexchange.com