vue elementui中使表的滚动条 滚到顶部或底部
1.设置table的ref为tableList 2.设置滚动至顶部 this.$refs.tableList.bodyWrapper.scrollTop =0; 3.设置滚动至底部 this.$refs.tableList.bodyWrapper.scrollTop =this.$refs.tableList.bodyWrapper.scrollHeight; //如果请求完更新数据,需要使用$nextTick this.$nextTick(() => { this.$refs.tableList.bodyWrapper.scrollTop=this.$refs.tableList.bodyWrapper.scrollHeight; })
参考文章:(19条消息) element ui table scrollTop 滚动到行头或行尾_elementui 表格行头行尾_yusirxiaer的博客-CSDN博客
posted on 2023-03-30 23:40 Mikasa-Ackerman 阅读(668) 评论(0) 编辑 收藏 举报