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"