我正在使用一个v-data-table
组件来显示来自 Firestore 数据库的数据。它看起来像这样:
批准/不批准功能运行良好,使用以下代码更新 Firestore 数据库:
database
.collection(member)
.doc(userId)
.update({
approved: status
})
.then({
console.log("School member details updated successfully")
return this.teachers.filter(teacher => {
return teacher.id != userId;
});
})
.catch(err => {
console.log(
"An error occured trying to update the school member details:",
err
);
});
但是,在 firestore 数据库上成功更新内容后,我不再想显示列表项,我认为像我在then()
代码块中所做的那样过滤数组会起作用,但它不会。
如何在不重新加载整个页面的情况下刷新客户端的数据?
您提到您不想在成功批准后显示特定列表项。正如你所使用的teacher.id != userId
。你用过teacher.id !== userId
吗?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句