DIEA
2021-12-12 18:00:19
我收到錯誤消息“糟糕。電子郵件地址格式錯誤。” 甚至當我什至不填寫任何內容時。我已經嘗試在不同的地方導入 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
提交
取消