键盘事件监听
created() {
const _this = this;
document.onkeydown = function (e) {
const key = window.event.keyCode;
if (key == 13) {
_this.loginJump('ruleForm');
}
};
},
methods: {
loginJump(loginForm) {
this.$refs[loginForm].validate((valid) => {
if (valid) {
this.$router.push('/home/firstScreenManage');
} else {
console.log('error submit!!');
return false;
}
});
},
cancelLogin(formName) {
this.$refs[formName].resetFields();
},
},