一、解决方案:

加上异步setTimeout,延迟获取dom的代码的执行

mounted() {
    // debugger
    this.$nextTick(()=> {
        setTimeout(()=> {
        let el = document.querySelector('.table')
        console.log(el)
        if(el) {
          // debugger
          this.offsetTop = el.offsetTop
          window.onscroll = () => this.getInvitationRecordUserList(this)
        }
      })
    })
  },  

  

任务:

  1、搞清楚vue中dom的渲染过程  

  2、vue技术揭秘:深入响应式原理代码分析(https://ustbhuangyi.github.io/vue-analysis/reactive/reactive-object.html#initstate)

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-11-19
  • 2023-03-27
  • 2021-11-19
  • 2021-11-19
  • 2021-11-19
相关资源
相似解决方案