Element-Ui 表格输入框回车进入下一行
<template slot-scope="scope">
<div id="tab_list">
<el-input
type="text"
placeholder=""
v-model="scope.row.OrderQuantity"
@keyup.native.enter="nextFocus($event,scope.$index,scope.row)"
></el-input>
</div>
</template>
methods:{
nextFocus(event,index,row){
let inputDoms = document.querySelectorAll(
"#tab_list .el-input__inner"
);
this.inputDoms=inputDoms;
const nextIndex = parseInt(index) + 1;
const length = this.inputDoms.length;
if (nextIndex < length) {
this.inputDoms[nextIndex].focus();
} else {
this.inputDoms[0].focus();
}
},
}