当前位置:网站首页>Scroll view realizes drop-down refresh (to avoid the drop-down problem triggered by the initial refresh triggered value of true when onload enters the page)
Scroll view realizes drop-down refresh (to avoid the drop-down problem triggered by the initial refresh triggered value of true when onload enters the page)
2022-07-24 00:53:00 【Lu Guang】
Avoid entering the page initially because refresher-triggered by true Before you can use the pull-down loading problem normally
<scroll-view scroll-y="true" :style="{height:scrollH+'px'}"
:refresher-triggered="triggered" @scrolltolower="scrolltolower"
:refresher-threshold="100"
@refresherrefresh="onRefresh" @refresherrestore="onRestore"
@refresherabort="onAbort" refresher-background="linear-gradient( to right, #A0AAFF,#5E6EFF)"
@refresherpulling="refreshPullingTap" :refresher-enabled="isRefresher">
<view></view>
</scroll-view>data(){
return{
scrollH:0,
triggered:false,
_freshing:false,
isRefresher:true
}
},
methods:{
scrolltolower(e){
uni.$u.throttle(this.commonPage(), 1000)
},
onRefresh(){
if (this._freshing) return;
this._freshing = true;
this.findRecruitNewsList(0);
let tName=setTimeout(()=>{
clearTimeout(tName)
this.triggered = false;
this._freshing = false;
},1000)
},
onRestore(){
this.triggered = 'restore';
},
onAbort(){
},
refreshPullingTap(){
},
}Key code :
onLoad(){
// Set a control to turn on the custom pull-down refresh switch
this.isRefresher=false;
let t=setTimeout(() => {
clearTimeout(t);
this.triggered = true;
}, 1000)
let ts=setTimeout(()=>{
clearTimeout(ts);
this.isRefresher=true;
},3000)
},
边栏推荐
- JS determines whether the element scrolls to the top
- Tutorial on principles and applications of database system (052) -- data integrity of MySQL (XIV): crosstab query (row column conversion)
- Leetcode set the intersection size to at least 2
- Classic examples of C language - use 4 × The matrix displays all integers from 1 to 16 and calculates the sum of each row, column, and diagonal
- Detailed overview of data standards -2022
- Tutorial on the principle and application of database system (046) -- MySQL query (VIII): group by
- [flyway introduction]
- Expérience du système réseau: résoudre les problèmes de ping
- 暑假第四周总结
- How to relieve the pillow quickly
猜你喜欢

Printf function - conversion description

Method of C language annotation

The prediction of domestic AI protein structure reproduced a breakthrough and solved the 3D structure with a single sequence. Peng Jian's team: "the last piece of puzzle since alphafold2 has been comp

Classic example of C language - find the minimum number of banknotes

Testers who have been employed for 3 months are facing employment confirmation. Leaders: 1 year of work experience is packaged into 5 years, and the probation period is eliminated

There are various signs that apple is expected to support AV1

Intelligent video monitoring solutions for elderly care institutions, using new technologies to help the intelligent supervision of nursing homes

Flutter | specifies the type of page return value

Easy gene | target gene DNA methylation sequencing (target BS)

Project scenario: NVIDIA SMI unable to datemine the device handle for GPU 0000:01:00.0: unknown error
随机推荐
Coloring old photos - deoldify get started quickly
Tutorial on the principle and application of database system (049) -- MySQL query (XI): sub query
Image processing 1:rgb888_ YCbCr444
Summary of the fourth week of summer vacation
Unity metaverse (I). Ready player me & blender customize your Avatar
Network system experiment: solve the problem of Ping failure
MySQL之数据查询(SELECT)
Graphic pipeline (I) post-processing stage alpha test template test depth test mix
Database connection pool & dbutils
Implementation of singleton mode in C #
项目场景:nvidia-smi Unable to datemine the device handle for GPU 0000:01:00.0: Unknow Error
Flutter | the easiest way to add header and footer to listview
Tutorial on the principle and application of database system (048) -- MySQL query (x): self connection query
Table custom table encapsulation
Bean Validation使用篇----05
T-seda code
Development of main applet for business card traffic near the map
Introduction to QT (2.1 the first procedure for the beginning of QT)
Tutorial on principles and applications of database system (052) -- data integrity of MySQL (XIV): crosstab query (row column conversion)
Testers who have been employed for 3 months are facing employment confirmation. Leaders: 1 year of work experience is packaged into 5 years, and the probation period is eliminated