The error is Uncaught TypeError: snapShotChnaged.forEach is not a function
. I need a specific row, that's why I am using the doc.
getAllDonations() {
firestore
.collection('donations')
.doc(this.$route.params.id)
.onSnapshot((snapShotChnaged) => {
this.donations = []
snapShotChnaged.forEach((donationDoc) => {
this.donations.push({
id: donationDoc.id,
name: donationDoc.data().name,
surname: donationDoc.data().surname,
class: donationDoc.data().class,
amount: donationDoc.data().amount
})
});
});
},
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…