当前位置:网站首页>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
边栏推荐
- Communication between parent-child components and parent-child components provide and inject
- 店铺排名问题,如何解决?
- A little understanding of pointer, secondary pointer, wild pointer, pointer as function return value
- Big manufacturers finally can't stand "adding one second", and companies such as Microsoft, Google meta propose to abolish leap seconds
- The difference between dynamic, VaR and object in fluent
- 基于STM32和阿里云的环境检测系统设计
- Summary on the thought of double pointer
- LCA board
- [kvm] install KVM
- UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
猜你喜欢
First knowledge of C language (3)
Design of environment detection system based on STM32 and Alibaba cloud
初识C语言(3)
Is the browser multi process or single process?
Press the missing number of interview question 17.04 | | 260. the number that appears only once (including bit operation knowledge points)
[principle] several ways of horizontal penetration
安装ros的laser_scan_matche库所遇到的问题(一)
VScode连接ssh遇到的问题
rman不标记过期备份
面试必备!TCP协议经典十五连问!
随机推荐
Typescript from getting started to mastering (XXII) namespace namespace (I)
C语言实现三子棋游戏(详解)
基于STM32和阿里云的环境检测系统设计
Safari's compatibility with Z-index
Wechat applet monitors sliding events on the screen
数据挖掘——关联分析例题代码实现(下)
View partition table format
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0x90 in position 614: ordinal not in range(128)
Data mining -- code implementation of association analysis example (Part 2)
关于双指针的思想总结
Problems encountered in vscode connection SSH
The output comparison function of Tim is introduced in detail through PWM breathing lamp and PWM controlled DC motor
Who can elaborate on the semi consistent read under mysqlrc and how to reduce the deadlock probability?
MPU6050
Note: restframe work records many to one tables, how to serialize in that table (reverse query)
SQL server当存储过程接收的参数是int类型时,如何做判断?
[原理] 横向渗透的几种方式
HCIP BGP
JS realizes the function of one click Copy
The data type of symbol, a new feature of ES6