问题描述
我有一个网站可以查询某人的薪水。每次单击图标,薪水数据将发送到Firebase。但这总是给我一个错误。 错误:FirebaseError:函数CollectionReference.doc()要求其第一个参数的类型为非空字符串,但它是:数组
我的数据库由一个人员列表组成,每个人都有其工资的详细信息,例如加班费,伙食津贴,基本工资等。
这是我的数据
data(){return{newSalary: {basicSalary:null,overtimePay:null,mealAllowance:null}}}
这是我的方法
async addGaji(rowIndex){
let values = Object.values(this.newSalary);
if (values.includes(null)){
showToast({
message: "Input is missing",color: "red"
});
console.log(this.operators[rowIndex].originalData.salary)
} else {
await db.collection('operator').doc(this.operators[rowIndex].originalData.salary).push(this.newSalary)
.then(() => {
showToast({
message: "Data has been uploaded",color:"blue"
})
})
.catch(console.log(this.operators[rowIndex].originalData.salary));
}
}
有人可以帮我解决这个问题吗? 我已经使用了concat,因为我认为它可以将新数组连接到firebase薪资数据中的现有数组
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)