vue js滚动到顶部底部

this.$nextTick(() => {
          this.ulDom = this.$refs.ul//高度不固定的子级元素,高度大于父级
          this.divDom = this.$refs.scrollcon//固定高度的父级元素
 })
 this.$nextTick(()=>{
                console.log(this.ulDom.offsetHeight)
                this.divDom.scrollTop = this.ulDom.offsetHeight
              })
发布了122 篇原创文章 · 获赞 5 · 访问量 4831

猜你喜欢

转载自blog.csdn.net/weixin_41254345/article/details/104481762