美文网首页
addEventListener、removeEventList

addEventListener、removeEventList

作者: coderfl | 来源:发表于2022-09-21 17:24 被阅读0次
    mounted () {
        window.addEventListener('scroll', this.lazyLoad)
    },
    destroyed() {
        window.removeEventListener('scroll', this.lazyLoad)
    },
    methods: {
          lazyLoad() {
            if (window.scrollY === 500 && this.month.send) {
              this.getMonthList()
            }
            if (window.scrollY === 1000 && this.late3Month.send) {
              this.getLate3MonthList()
            }
          },
    }
    

    相关文章

      网友评论

          本文标题:addEventListener、removeEventList

          本文链接:https://www.haomeiwen.com/subject/ywowortx.html