用户希望填写完用户名后敲回车自动换行到填写密码的输入框,研究了一下该功能,记录一下
input代码
<el-form-item>
<el-input v-model="userform.username" autocomplete="off" placeholder="用户名" @keyup.enter.native="lineFeed">
</el-input>
</el-form-item>
<el-form-item>
<el-input ref="password" type="password" v-model="userform.userpassword" autocomplete="off" placeholder="密码" @keyup.enter.native="userconfirm"></el-input>
</el-form-item>
js代码
//换行
lineFeed(){
this.$refs.password.focus();
},