在以下代码中,在我更新字段集合后,它不会更新“this.fields”(通过 vuexfire 规则绑定到 store.js 中的集合)-仅当我刷新页面时。请帮忙。谢谢
var newField = {
name: this.fieldName,
area: this.fieldArea,
farmId: this.farmId
}
var docRef = fb.field.doc()
docRef.set(newField)
var id = docRef.id
console.log(id)
fb.field
.doc(id)
.get()
.then(ref => {
this.$store.commit('updateCurrentField', ref.data())
})