vue 触发按钮触发滚动条到底部的方法
// 触发滚动条滚动到底部
this.toBottom()
<div><el-button @click="toBottom()">滚动到底部</el-button></div>
toBottom(){
// 变量scrollHeight是滚动条的总高度
let scrollHeight = document.documentElement.scrollHeight||document.body.scrollHeight;
this.$nextTick(() => {
// 滚动内容的坐标位置0,50000:
window.scrollTo(0,scrollHeight);
});
},