onPullDownRefresh 监听该页面用户下拉刷新事件 需要在 pages.json 里 开启 enablePullDownRefresh
"globalStyle": {
}
当处理完数据刷新后,uni.stopPullDownRefresh 可以停止当前页面的下拉刷新
uni.startPullDownRefresh(OBJECT)
success Function 否 接口调用成功的回调 fail Function 否 接口调用失败的回调函数 complete Function 否 接口调用结束的回调函数
uni.stopPullDownRefresh() 停止当前页面下拉刷新
page.json 开启下拉刷新
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "hi uni",
"enablePullDownRefresh": true
}
},
index.vue
<view v-for="(item, index) in newsList" class="newslist">{{item}}</view>
onPullDownRefresh:function(){
this.getList();
},
导航
uni.navigateTo
uni.redirectTo
uni.reLaunch
uni.switchTab
uni.navigateBack
保留当前页面,跳转到应用内的某个页面,使用uni.navigateBack
可以返回到原页面。
关闭当前页面,跳转到应用内的某个页面。
uni.reLaunch 关闭所有页面,打开到应用内的某个页面。
uni.switchTab 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面。
uni.navigateBack 关闭当前页面,返回上一页面或多级页面
设置导航条 uni.setNavigationBarTitle uni.showNavigationBarLoading uni.hideNavigationBarLoading uni.setNavigationBarColor
uni.showToast uni.showLoading uni.hideToast uni.hideLoading uni.showModal uni.showActionSheet https://uniapp.dcloud.io/api/system/info
1、系统信息
2、网络状态
3、加速度计
4、拨打电话
5、剪贴板
6、屏幕亮度
7、振动
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有