小程序 WXS响应事件(超出两屏显示返回顶部按钮)
两种解决办法:
view页面形式实现:
<wxs module="test" src="./test.wxs"></wxs> // 引入wxs
<scroll-view
bindscroll="onPageUpdate"
style='height:100%;'
scroll-y
scroll-with-animation="true" >
</scroll-view>
<!-- 返回顶部按钮 -->
<view bindtap="scrollTop" class="back-top-btn">
<view class="back-top-btn-box">
<text>回到</text>
<text>顶部</text>
</view>
</view>
Page({
data: {
windowHeight: app.globalData