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>
相关推荐
脾气有点小暴2 小时前
uniapp自定义头部导航
前端·uni-app
前端 贾公子7 小时前
[uniapp][swtich开关]阻止切换状态(类似阻止事件冒泡)
uni-app
雪芽蓝域zzs10 小时前
uniapp基于picker选择器实现年月日时分秒
uni-app
niucloud-admin11 小时前
本地开发部署——uniapp端站点部署
uni-app
毕设源码-郭学长1 天前
【开题答辩全过程】以 基于uni-app的维修上门服务小程序设计与实现为例,包含答辩的问题和答案
uni-app
xiaohe06011 天前
📦 Uni ECharts 是如何使用定制 echarts 的?一篇文章轻松掌握!
vue.js·uni-app·echarts
Front思1 天前
uniapp实现物流节点
uni-app
赵庆明老师2 天前
uniapp 微信小程序页面JS模板
javascript·微信小程序·uni-app
熬耶2 天前
uniapp 简单实现列表左滑操作
uni-app
小白学过的代码2 天前
UniApp 引入 Cesium 开发: RenderJS 避坑
uni-app