老师关于这个scroll组件

来源:10-21 阿里云域名注册、解析与备案流程

十六夜月华

2019-11-18

老师的代码里面在重新刷新高度之后会重新绑定scroll事件。这个是起到什么作用呢。

写回答

1回答

Sam

2019-11-21

你好,我看了下课程源码,刷新高度后没有绑定 scroll 事件,事实上也不需要哈:

methods: {
  refresh() {
    if (this.$refs.scrollWrapper) {
      this.$refs.scrollWrapper.style.height = window.innerHeight - realPx(this.top) - realPx(this.bottom) + 'px'
    }
  }
}


0
0

Vue 实战商业级读书Web APP完整项目

Vue全家桶+最新前端技术+前后端分离架构,完整项目流程

1621 学习 · 1951 问题

查看课程