如何使用vue.js向Firebase Firestore添加新系列?
如何使用Firebase 9.8.2添加新系列
methods: {
registerUser(){
const auth = getAuth();
createUserWithEmailAndPassword(auth, this.user.email, this.user.password).then((datauser)=>{
dbItemAdd.add({
name: this.user.name,
email: this.user.email,
uid: datauser.user.uid,
})
router.push({
name:'home'
})
}).catch((error) => {
console.log(error.code)
switch (error.code) {
case "auth/invalid-email":
this.errMsg = "Invalid email";
break;
case "auth/weak-password":
this.errMsg = "weak password";
break;
case "auth/email-already-in-use":
this.errMsg = "email already in use";
break;
}
})
}
},
How can I add a new collection with Firebase 9.8.2
methods: {
registerUser(){
const auth = getAuth();
createUserWithEmailAndPassword(auth, this.user.email, this.user.password).then((datauser)=>{
dbItemAdd.add({
name: this.user.name,
email: this.user.email,
uid: datauser.user.uid,
})
router.push({
name:'home'
})
}).catch((error) => {
console.log(error.code)
switch (error.code) {
case "auth/invalid-email":
this.errMsg = "Invalid email";
break;
case "auth/weak-password":
this.errMsg = "weak password";
break;
case "auth/email-already-in-use":
this.errMsg = "email already in use";
break;
}
})
}
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论