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>
相关推荐
半开半落10 小时前
uniapp通过npm使用第三方库兼容微信小程序
微信小程序·npm·uni-app
随笔记11 小时前
HbuilderX载入项目,运行后唤起微信开发者工具,提示:Error: Fail to open IDE,唤醒不起来怎么办
javascript·微信小程序·uni-app
Lsx_11 小时前
一文读懂 Uniapp 小程序登录流程
前端·微信小程序·uni-app
夏目友人爱吃豆腐12 小时前
uniapp源码解析(Vue3/Vite版)
前端·vue.js·uni-app
2501_9151063214 小时前
iOS 抓包全流程指南,HTTPS 抓包、TCP 数据流分析与多工具协同的方法论
android·tcp/ip·ios·小程序·https·uni-app·iphone
邱泽贤14 小时前
uniapp 当前页调用上一页的方法
前端·javascript·uni-app
集成显卡14 小时前
AI取名大师 | uni-app 微信小程序打包 v-bind、component 动态组件问题
人工智能·微信小程序·uni-app
anyup1 天前
支持鸿蒙!开源三个月,uView Pro 开源库近期更新全面大盘点,及未来计划
前端·vue.js·uni-app
阿斌_bingyu7091 天前
uniapp实现android/IOS消息推送
android·ios·uni-app
茶憶1 天前
UniApp RenderJS中集成 Leaflet地图,突破APP跨端开发限制
javascript·vue.js·uni-app