vxe-table,设置某列不显示时,表头表体对应错乱,添加一行,定位到当前行
key值原先绑定的是索引,应该绑strfield
refreshTable(){
this.tableKey = Math.random()
}
//添加一行
<vxe-table
ref="table"
:key="tableKey"
>
methods:{
//滚动到左侧
this.tableKey = +new Date()
setTimeout(() => {
// 定位到添加行
const lastRow = this.mainForm.costapplydetailList[this.mainForm.costapplydetailList.length - 1]
this.$refs.table.setActiveRow(lastRow)
this.$refs.table.setCurrentRow(lastRow)
this.$refs.table.scrollToRow(lastRow)
})
}