使用 vuefire 允许我在 vue 实例上设置一个 firestore 对象并自动将其与 Firestore 同步。我还想过滤另一个数据点,但过滤会导致错误。
下面的代码返回所需的工作人员并完美地工作。Firebase 用户 (fbUser) 返回
WEBPACK_IMPORTED_MODULE_0__services_Firebase .a.collection(...).filter 不是函数
并且 VueTools 中的数据点为空
firestore() {
return {
staff: db.collection('staff').orderBy('lastname'),
fbUser: db.collection('staff').filter(s => s.email === this.current_user.email)
}
},