zoukankan      html  css  js  c++  java
  • iview table表格自动定位到某一行且选中滚动到相应的位置

    this.applyTable.tableData[1]._highlight = true//高亮某一行 util.isEmpty是一个工具类用来判断是否为空或者null的   此表格用的是iview ui 已.ivu开头的为iview表格,其它ui框架请自行更换即可
    setTimeout(() => {
           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: "start",
                      inline: "nearest"
                    }
                    )
                }, 100)
     
    
    behavior:定义过渡动画。"auto","instant"或"smooth"。默认为"auto"。
    
    block:"start","center","end"或"nearest"。默认为"center"
    
    inline  "start","center","end"或"nearest"。默认为"nearest"
  • 相关阅读:
    UVa 481
    ZOJ 1108 & HDU 1160
    UVa 11450
    UVa 11242
    UVa 750
    UVa 725
    UVa 483
    UVa 10258
    UVa 793
    The Little Girl who Picks Mushrooms HDU 4422 水题类似模拟的一种感觉
  • 原文地址:https://www.cnblogs.com/yn-cn/p/12068489.html
Copyright © 2011-2022 走看看