小程序mpvue使用scroll-view

// autoHeight 必须有高度 :scroll-y="true"  设置横向竖向滚动
<scroll-view :style="{height:autoHeight}" :scroll-y="true"  @scroll="scroll"  :scroll-with-animation="true" class="scroll-warp" :enable-back-to-top="true">
 </scroll-view> 
         
scroll(e) {
              // console.log(e.mp.detail.scrollTop)
               if(e.mp.detail.scrollTop>36){
                   this.navBackgroundColor = '#fff'
                   this.titleColor = 'black'
                   this.title = '智慧家工程师'
                   this.returnLeft = ''
               }else{
                   this.title = ''
                   this.navBackgroundColor = ''
                   this.titleColor = '#fff'
                   this.returnLeft = ''
               }
            }, 
posted @ 2021-02-23 20:07  Panax  阅读(265)  评论(0编辑  收藏  举报