微信小程序滚动到页面顶部

文章目录

    低版本的微信小程序基础库不支持,需要注意:

    if (wx.pageScrollTo) {  // 判断是否支持该函数
      wx.pageScrollTo({
        scrollTop: 0
      })
    }