我有一个函数,它有一个我希望在另一个函数中使用的值
Submit: function (e) {
e.preventDefault();
var email = this.refs.email.value;
var pass = this.refs.pass.value;
if (email && pass !== '' ) {
const auth = firebase.auth();
const promise = auth.signInWithEmailAndPassword(email, pass);
promise.catch(e => { console.log(e.message) });
promise.then(() => {
console.log('Logged in');
})
}
}
现在我想在下面的另一个函数中使用这个e.message对象:
renderError: function() {
if (error) {
<Error custom{//here i want to use that e.message}/>
}
}