在el-table身上有个bodyWrapper属性,我们可以通过这个属性拿到真实DOM从而来操作滚动条
代码:
<el-table ref="chatListRef">...</el-table>
// 滚动条滚动到底部
this.$refs.chatListRef.bodyWrapper.scrollTop = this.$refs.chatListRef.bodyWrapper.scrollHeight
在el-table身上有个bodyWrapper属性,我们可以通过这个属性拿到真实DOM从而来操作滚动条
代码:
<el-table ref="chatListRef">...</el-table>
// 滚动条滚动到底部
this.$refs.chatListRef.bodyWrapper.scrollTop = this.$refs.chatListRef.bodyWrapper.scrollHeight