【发布时间】:2020-10-17 03:15:31
【问题描述】:
我发现很难在其他方法中使用 firestore 承诺返回的值,因为我越来越不确定。我尝试以下面的方式使用 async/await,但仍然没有成功。
get_board_details(){ db.collection('members').where('board_id','==',this.$route.params.groupslug).get().then(querySnapshot=>{
querySnapshot.forEach( async doc=>{
this.owner_id = await doc.data().owner_id;
})
})
console.log(this.owner_id)
},
【问题讨论】:
标签: javascript firebase vue.js google-cloud-firestore