JS之el-input 回车触发事件并且重新聚焦全选文本
el-input 回车触发事件并且重新聚焦全选文本
———————————————————————
methods: {
enterInput() {
this.$refs.toFoucus.select() // 重新选择
this.$nextTick(() => {
this.$refs.toFoucus.focus();//输入框默认获取焦点
});
},
getInputFocus(event) {
event.currentTarget.select();
}
}