方法1:scrollTop 滚动到某位置
document. documentElement. scrollTop = 380;// 直接跳转到380的高度不需要加单位
方法2:scrollTo,scrollBy,scroll滚动到某位置
//第一个坑,ref绑定的元素不能是display:
// 第二要力口上this .nextTtch
this.$nextTick(() => {
this.$refs.DOM.scrollTo(0,380);
))
方法3:scrollIntoView() 实现滚动到具体某元素
document.getElementById("ID").scrollIntoView