添加一行,滚动到最左侧,滚动到当前行,定位到当前行

<vxe-table
          ref="table"
          :key="tableKey"
>
addRow() {
// 滚到最左侧
      this.tableKey = +new Date()
const list = {
        lngemployeeid: '',
}
setTimeout(() => {
          // 定位到添加行
          this.$refs.table.setActiveRow(list)
          const lastRow = this.detailDialog.tableData[this.detailDialog.tableData.length - 1]
          this.$refs.table.setCurrentRow(lastRow)
          this.$refs.table.scrollToRow(lastRow)
        })

 

posted @ 2024-04-28 17:12  hello芳芳  阅读(5)  评论(0编辑  收藏  举报