<el-table
:data="dataList"
height="400"
ref="containerTable"
>
</el-table>
let item = {
name: '111',
age: 22,
}
this.dataList.push(item)
// 跳到底部操作
this.$nextTick(() => {
this.$refs.containerTable.bodyWrapper.scrollTop = this.$refs.containerTable.bodyWrapper.scrollHeight
});
//跳到顶部操作
this.$refs.containerTable.bodyWrapper.scrollTop =0 //可根据页面高度设置
参考: