[Vuejs]-I want to wrap the firebase image path in v-for

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;
},

Leave a comment