当前位置:网站首页>Applet: Area scrolling, pull-down refresh, pull-up load more
Applet: Area scrolling, pull-down refresh, pull-up load more
2022-07-29 04:08:00 【[email protected]】
One 、 brief introduction
development environment : Applet 、uniapp
Realization function : List page implementation , Area scrolling 、 The drop-down refresh 、 Pull up to load more , The effect is as shown in the picture :
normal :

The drop-down refresh :

Pull on loading :

Two 、 Realization
2.1、 Code
<scroll-view scroll-y="true" class="scroll-Y" @scrolltolower="lower" refresher-enabled="true" @refresherrefresh="refresher" :refresher-triggered="triggered" @refresherrestore="onRestore" @refresherabort="onAbort" v-if = "patList.length > 0">
<view class="itemList" @click="toDetail(item.caseId,item.identifier)" v-for="(item,index) in patList" :key="index">
<view class="title">
<span class="name"> Weng Meiling </span>
<span class="time">2022-07-15</span>
</view>
</view>
<view class="loading">
<view class="tips" v-if="loadings === '0'"> This is my bottom line ~</view>
<view class="tips" v-else-if="loadings === '1'"> Pull up to load more ...</view>
<view class="imgs" v-else-if="loadings === '2'">
<image src="load.png" mode=""></image>
<text> Loading ...</text>
</view>
</view>
</scroll-view>
-------------------------------------------------
lower(){
console.log(' Scroll to the bottom ')
this.page ++
this.getList()
},
refresher(){
console.log(' The drop-down refresh ',this._freshing,this.triggered)
if (this._freshing) return;
this._freshing = true;
this.triggered = true
this.page = 1
this.getList()
//getList After the method is executed, restore the following two states
//this.triggered = false;
//this._freshing = false;
},2.2、 analysis :
2.2.1、<scroll-view></scroll-view>, Define the area to scroll
2.2.2、:scroll-y, Allow vertical scrolling
2.2.3、@scrolltolower="lower", event : Scroll to the bottom / Trigger on the right , You can call to load the data of the next page
2.2.4、:refresher-enabled="true", attribute : Enable custom drop-down refresh
2.2.5、@refresherrefresh="refresher", event : Custom pull down refresh triggered , You can call the interface again
2.2.6、:refresher-triggered="triggered", attribute : Set the current pull-down refresh status ,true Indicates that the pull-down refresh has been triggered ,false Indicates that the pull-down refresh is not triggered
2.2.7、@refresherrestore="onRestore", event : Custom pull down refresh reset
2.2.8、@refresherabort="onAbort", event : Custom pull down refresh aborted
3、 ... and 、 Although it's very simple , But I think every knowledge point should be recorded . Welcome to communicate and correct , Pay attention to me , Learning together .
Four 、 Reference documents :
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/210/202207290407316463.html
边栏推荐
- 优炫数据库有办法查到主集群每天传给备集群的日志量吗?
- Configmap配置与Secret加密
- GBase 8a特殊场景下屏蔽 ODBC 负载均衡方式?
- UCOS task switching process
- Pointer constant and constant pointer
- HCIP BGP
- Value transmission and address transmission of C language, pointer of pointer
- 3. Solve pychart's error unresolved reference 'selenium' unresolved reference 'webdriver‘
- Wechat applet monitors sliding events on the screen
- Mmdetection preliminary use
猜你喜欢

初识C语言(3)

SQL window function

Data mining -- code implementation of association analysis example (Part 2)
![[kvm] create virtual machine from kickstart file](/img/0e/292ccb6862e29d948ad6ece86b7945.png)
[kvm] create virtual machine from kickstart file

mmdetection初步使用

为什么opengauss启动的时候这么多的unknown?

Interview essential! TCP classic 15 consecutive questions!

面试必备!TCP协议经典十五连问!

力扣面试题17.04 消失的数字||260.只出现一次的数字(内含位运算知识点)

Lua语言(stm32+2G/4G模块)和C语言(stm32+esp8266)从字符串中提取相关数据的方法-整理
随机推荐
小马智行进军前装量产,从自研域控制器入手?
Arrow function of new features of ES6
Mmdetection preliminary use
LDP --- 标签分发协议
Ma Zhixing entered the mass production of front loading, starting with the self-developed domain controller?
基于STM32和阿里云的环境检测系统设计
Asp.net MVC中文件夹中的控制器如何跳转到根目录的控制器中?
String template of ES6 new features and methods to simplify objects and functions
How to execute insert into select from job in SQL client
安装postgis时报找不到“POSTGIS_VERSION”这个函数
【BGP】小型实验
[BGP] small scale experiment
Lucifer 98 life record ing
Who can elaborate on the semi consistent read under mysqlrc and how to reduce the deadlock probability?
"Weilai Cup" 2022 Niuke summer multi school training camp 2H
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
STM32F103ZET6程序移植为C8T6+C8T6下载程序flash timeout的解决方案
BGP的基础配置---建立对等体、路由宣告
数据集成这个地方的过滤条件该咋写,用的啥语法?sql语法处理bizdate可以不
Simple cases of inner connection and left connection