微信小程序分页加载
2021/6/9 20:25:56
本文主要是介绍微信小程序分页加载,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
<view>
<form catchsubmit="formSubmit" catchreset="formReset">
<input class="weui-input" name="title" placeholder="这是一个输入框" />
<button style="margin: 30rpx 0" type="primary" formType="submit">搜索</button>
</form>
<block wx:for="{{str}}" wx:key='key'>
<view>
<rich-text nodes="{{item.title}}"></rich-text>
<text>{{item.content}}</text>
</view>
</block>
<view class="body">
<block wx:for="{{fang}}" wx:key="item">
<view class="a">
<view class="a-1"><image src="{{item.img}}"></image></view>
<view class="a-2">
<view>{{item.name}}</view>
<view>{{item.desc}}</view>
</view>
</view>
</block>
</view>
</view>
js
data: {
fang:[],
page:1,
pagmax:6
},
let page=this.data.page
wx.request({
url: 'http://localhost/index.php/api/show',
data:{page},
success:e=>{
// console.log(e)
page++;
this.setData({
fang:e.data.data,
})
console.log(page);
}
})
这篇关于微信小程序分页加载的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-10-04微信小程序如何实现点击图片查看大图功能-icode9专业技术文章分享
- 2024-09-28uniapp 小程序获取到数据库的换行符怎么展示-icode9专业技术文章分享
- 2024-09-20微信小程序全栈项目实战:从零开始的全面指南
- 2024-09-20微信小程序项目实战:零基础入门教程
- 2024-09-19微信小程序项目中miniprogram_npm文件跟node_modules文件的差别-icode9专业技术文章分享
- 2024-08-27小程序 单行显示,超出部分省略号显示的方法代码-icode9专业技术文章分享
- 2024-08-27微信小程序如何获取到特种设备的刘海屏高度-icode9专业技术文章分享
- 2024-08-27微信小程序如何获取苹果手机底部一横线高度信息方法代码-icode9专业技术文章分享
- 2024-08-27微信小程序 顶部状态栏标签背景为none但还是看不到状态栏什么原因-icode9专业技术文章分享
- 2024-08-21微信小程序全栈入门:从零开始的一站式指南