1👍
getDownloadURL()
is an asynchronous method so you should declare your method as async
and use await
, as follows (untested):
async getImageSrc(id) {
const skinId = this.$store.getters['skin/getSkinId']
const state = this.$store.getters['skin/getSkinState']
const storageRef = this.$fire.storage.ref()
const imageRef = storageRef.child(`skin/${id}_${skinId}${state}.webp`)
const downloadURL = await imageRef.getDownloadURL();
return downloadURL;
},
Source:stackexchange.com