vue项目中,滚动条恢复初始位置的方法

项目场景:

vue项目中,滚动条恢复初始位置的方法

 this.$nextTick(()=>{
    
    
          let dom = document.getElementById('addContent');
          if(dom!==null){
    
    
            dom.scrollTop = 0;
          }
        })

猜你喜欢

转载自blog.csdn.net/m0_55588706/article/details/126227050