我收到错误消息“糟糕。电子邮件地址格式错误。” 甚至当我什至不填写任何内容时。我已经尝试在不同的地方导入 Firebase,但它没有解决问题。<script>import firebase from "firebase";export default { name: "login", data() { return { email: "", password: "" }; }, methods: { login: function() { firebase .auth() .signInWithEmailAndPassword(this.email, this.password) .then( function(user = user) { alert("Well done! You are now logged in"); }, function(err) { alert("Oops. " + err.message); } ); } }};</script>
2 回答
jeck猫
TA贡献1909条经验 获得超7个赞
使用以下代码修复它:
<script>
import firebase from 'firebase';
export default {
name: 'login',
data() {
return {
email: '',
password: ''
}
},
methods: {
login: function() {
firebase.auth().signInWithEmailAndPassword(this.email, this.password).then(
(user) => {
this.$router.replace('home')
},
(err) => {
alert('Oops. ' + err.message)
}
);
}
}
}
</script>
添加回答
举报
0/150
提交
取消