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)
          })
}
posted @ 2024-04-30 11:27  hello芳芳  阅读(26)  评论(0编辑  收藏  举报