【发布时间】:2019-01-04 15:38:43
【问题描述】:
我创建了一个帖子并将其存储在Cloud Firestore 中,现在我想将数据输出到我的vueJs 文件中,名为Dashboard.vue。
但我不知道它是如何工作的。我自己尝试了一些想法,但没有得到好的结果。
那么我怎样才能输出这些数据呢?
文件:
Firebase => Cloud Firestore
和
在vueJspost.vue创建post方法
createPost () {
fb.postsCollection.add({
postDetails: {
createdOn: this.postDetails.createdOn,
content: this.postDetails.content,
userId: this.currentUser.uid,
image: this.postDetails.image,
comments: this.postDetails.comments,
likes: this.postDetails.likes
}
}).then(ref => {
this.post.content = ''
this.$router.push('/dashboard')
}).catch(err => {
console.log(err)
})
}
【问题讨论】:
标签: firebase vue.js google-cloud-firestore