<el-input id="insertInfoBcbd" v-model="insertInfoBcbd"></el-input>
<el-table
ref="table1"
:data="tableData1"
border
highlight-current-row
:row-class-name="table1RowClassName"
@row-click="rowClick1"
@current-change="currentChange1"
style="width: 100%">
</el-table>
data(){
return{
insertInfoBcbd:'0',
tableData1:[{cbbh:10081,index:0},{cbbh:10086,index:1},{cbbh:10084,index:2},{cbbh:10082,index:3},{cbbh:10083,index:4},{cbbh:10085,index:5},],
checkedRowNum1:0,
currentRow1:null,
}
},
mounted(){
$('#insertInfoBcbd').keyup(()=>{
if(event.keyCode == 13){
this.bottomInputBlur();
}
});
},
methods:{
bottomInputBlur(){
this.checkedRowNum1=this.checkedRowNum1+1
if (this.checkedRowNum1 >= this.tableData1.length) {
this.checkedRowNum1=0
}
this.setCurrent1(this.tableData1[this.checkedRowNum1])
},
rowClick1(row, column, event){
console.log(this.currentRow1)
this.checkedRowNum1=row.index
},
currentChange1(val){
this.currentRow1=val
},
setCurrent1(row) {
this.$refs.table1.setCurrentRow(row);
},
table1RowClassName({row, rowIndex}) {
row.index=rowIndex
},
}