目录
1.0 项目案例图
2.0 wxml代码
<swiper-item>
<scroll-view scroll-y style="height:{{screhei}}px;" bindscrolltolower="downhint">
<view class="item_box" wx:for="{{18}}">
<view class="item_text">某某数字成功入选湖南省产教融合型企业</view>
<view class="item_text">2023-07-09</view>
</view>
</scroll-view>
</swiper-item>
在<scroll-view>标签中添加bindscrolltolower="downhint"属性,这个bindscrolltolower属性的作用是当滑块滑到最底部,没有内容的时候生效的一个滑动事件。
3.0 js代码
downhint:function() {
wx.showToast({
title: '已到底啦!'
})
}
在js界面中只需要写一个downhint:function() {},在其中写入一个wx.showToast({})弹窗API,将提示文字写在API的title: '已到底啦!'中。注意title: ''中的提示文字不得超过七个字符。