解决办法,给elinput绑定blur事件
usernameBlur(){
if (!this.loginForm.username || !this.loginForm.password) {
const userName = this.$refs.username.$el.children[0].value
const passWord = this.$refs.password.$el.children[0].value
if (userName != '') {
this.loginForm.username = userName
}
if (passWord != '') {
this.loginForm.password = passWord
}
}
},