iview table表格自动定位到某一行且选中滚动到相应的位置

     this.applyTable.tableData[11]._highlight = true  //选中某一行的
    this.$nextTick().then(  //滚动条的滚动到具体位置
      () => {
        util.isEmpty(document.querySelector('.testClass .ivu-table-tbody .ivu-table-row-highlight')) ? '' : document.querySelector('.testClass .ivu-table-tbody .ivu-table-row-highlight').scrollIntoView({
          behavior: "instant",
          block: "end",
          inline: "nearest"
        });
      }
    )

behavior:定义过渡动画。"auto","instant""smooth"。默认为"auto"

block:"start""center""end""nearest"。默认为"center"

inline  "start""center""end""nearest"。默认为"nearest"

猜你喜欢

转载自www.cnblogs.com/yn-cn/p/12068489.html