1.在el-form 上添加
@submit.native.prevent
<el-form :model="user" status-icon size="small" :rules="loginRules" ref="loginForm" @submit.native.prevent>
2.在密码框
<el-input type="password" placeholder="请输入密码" v-model="user.password" @keyup.enter.native.prevent="login()"></el-input>
添加:@keyup.enter.native.prevent="login()"
3.上述使用chorm 火狐
ie下不生效
4.
created() {
let that = this;
document.onkeydown = function(e){
let key = window.event.keyCode;
if(key == '13'){
that.login();
}
}
}
ie生效
博客主要讲述在el-form上添加操作,在密码框添加@keyup.enter.native.prevent=\login()\,该操作在Chrome、火狐浏览器下不生效,重点提及要让其在IE浏览器生效。
3428

被折叠的 条评论
为什么被折叠?



