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>
相关推荐
RuoyiOffice10 小时前
企业请假销假系统设计实战:一张表、一套流程、两段生命周期——BPM节点驱动的表单变形术
java·spring·uni-app·vue·产品运营·ruoyi·anti-design-vue
KongHen0211 小时前
uniapp-x实现自定义tabbar
前端·javascript·uni-app·unix
RuoyiOffice15 小时前
SpringBoot+Vue3+Uniapp实现PC+APP双端考勤打卡设计:GPS围栏/内网双模打卡、节假日方案、定时预生成——附数据结构和核心源码讲解
java·spring·小程序·uni-app·vue·产品运营·ruoyi
2501_9159214318 小时前
2026 iOS 上架新趋势 iOS 发布流程模块化
android·ios·小程序·https·uni-app·iphone·webview
窝子面1 天前
uni-app的初体验
uni-app
笨笨狗吞噬者1 天前
【uniapp】微信小程序实现自定义 tabBar
前端·微信小程序·uni-app
雪芽蓝域zzs2 天前
uniapp MD5加密 加密传输 密码加密
uni-app
2501_915909062 天前
iOS 抓包不越狱,代理抓包 和 数据线直连抓包两种实现方式
android·ios·小程序·https·uni-app·iphone·webview
给钱,谢谢!2 天前
记录uni-app Vue3 慎用 Teleport,会导致页面栈混乱
前端·vue.js·uni-app
郑州光合科技余经理2 天前
海外O2O系统源码剖析:多语言、多货币架构设计与二次开发实践
java·开发语言·前端·小程序·系统架构·uni-app·php