uniapp 解决scroll-view组件 refresher-triggered刷新无效

直接上代码 看代码注释

javascript 复制代码
	const isRefresh = ref(false); //下拉刷新状态
		// 下拉刷新
	async function refresherpulling() {
		renderArr.value = [];
		isRefresh.value = true; // 先赋为true 调用完接口再设为false
		await reqData();
		isRefresh.value = false; // 重置状态
	}

下面是组件视图

主要属性

  1. refresher-enabled 开起刷新
  2. refresher-triggered 下拉刷新状态
  3. @refresherrefresh 下拉刷新事件
javascript 复制代码
<view class="img_box">
		<scroll-view class="scrollView" scroll-y refresher-enabled @scrolltolower="getNext"
			:refresher-triggered="isRefresh" @refresherrefresh="refresherpulling">
			<view class="one_img" v-for="(item,index) in renderArr" :key="item._id" @click="toView(item)">
				<view class="aut">
					{{ item.author }}
				</view>
			</image>
			</view>
	
		</scroll-view>
	</view>
相关推荐
AnalogElectronic12 分钟前
uniapp学习7,美团闪购生鲜蔬菜商家详情页
javascript·学习·uni-app
AnalogElectronic23 分钟前
uniapp学习4,简易记事本2.0
学习·uni-app
小旋风0123434 分钟前
uniapp开发app解决视频层级太高的问题(subNvue方法)
前端·uni-app·音视频
00后程序员张7 小时前
从审核被拒到稳定过审,iOS 上架技术优化
android·ios·小程序·https·uni-app·iphone·webview
洗发水很好用1 天前
uniapp纯css实现基础多选组件
前端·css·uni-app
2501_915918411 天前
WebKit 抓包,WKWebView 请求的完整数据获取方法
android·前端·ios·小程序·uni-app·iphone·webkit
AnalogElectronic1 天前
uniapp学习1,hello world 项目,打包到微信小程序,贪吃蛇小游戏
学习·微信小程序·uni-app
雪芽蓝域zzs1 天前
uniapp 真机上传图片提示打包未添加Camera模块
android·uni-app
不爱说话郭德纲2 天前
uni-app x iOS 离线打包踩坑总结
uni-app·xcode
pengles2 天前
基于RuoYi-Vue-Plus项目实现移动端项目
java·vue.js·uni-app