vue 通过回车键使焦点移到(focus)下一个element ui输入框
<el-form-item label="邮箱" prop="email"><el-inputv-model="addForm.email"@keyup.native.enter="focusNext('mobile')"></el-input></el-form-item><el-form-item label="手机" prop="mobi
·
<el-form-item label="邮箱" prop="email">
<el-input v-model="Form.email" @keyup.native.enter="focusNext('mobile')"></el-input>
</el-form-item>
<el-form-item label="手机" prop="mobile">
<el-input v-model.number="Form.mobile" ref="mobile"></el-input>
</el-form-item>
//下面的写在methods里
focusNext(nextRef) {
this.$refs[nextRef].focus()
}
更多推荐
已为社区贡献1条内容
所有评论(0)