[Vuejs]-I am stuck trying to retrieve images from Firebase to my Vue application

0👍

In this case, create an imgUrl collection in firestore and save the image URL in that collection and call them in the created()hook.

  task.on('state_changed', (snapshot) => {
                let percentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;
                this.value = percentage;

                snapshot.ref.getDownloadURL().then(
                    (DownloadURL) => {
                        this.imgURL = DownloadURL;

                        db.collection("imgUrl").add({
                         url: this.imgurl
                         })
                    }
                )
            })

Leave a comment