当前位置:网站首页>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)
},
边栏推荐
- [STM32] basic knowledge of serial communication
- The most basic code interpretation of C language
- [video game training] non contact object size and shape measurement 2020 video game G
- Bert article translation
- Problem note - unable to open include file: "direct.h": no such file or directory
- Intelligent video monitoring solutions for elderly care institutions, using new technologies to help the intelligent supervision of nursing homes
- NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘
- Design details related to sap e-commerce cloud Spartacus UI store
- Okaleido tiger NFT is about to log in to the binance NFT platform. Are you looking forward to it?
- Robot dog back submachine gun shooting video fire, netizens shivering: stoooooooopppp!
猜你喜欢

入职3个月的测试员面临转正,领导:1年工作经验包装成5年,试用期淘汰

【电赛训练】非接触物体尺寸形态测量 2020年电赛G题

Classic example of C language - commodity inspection code

Image processing: Generation 3 × Window of 3

Classic examples of C language - adding two scores

First knowledge of C language functions

NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘

Classic example of C language - convert the input two digits into English

Expérience du système réseau: résoudre les problèmes de ping

Creo 9.0 mouse button operation for model observation
随机推荐
Bert article translation
Difference between data index and label system of data warehouse
Implementation of singleton mode and prevention of reflection and serialization
Prometheus+node exporter+grafana monitoring server system resources
Solve the error: uncaught (in promise) navigationduplicated: avoided redundant navigation to current location:“
Installation and use of appscan
JS determines whether the element scrolls to the top
[the 83rd fortnight of leetcode]
Method of C language annotation
Tutorial on the principle and application of database system (050) -- MySQL query (XII): analysis of the execution process of select command
[QNX Hypervisor 2.2用户手册]9 VM配置参考
MySQL之数据查询(SELECT)
JS related knowledge
Tutorial on the principle and application of database system (048) -- MySQL query (x): self connection query
js的相关知识
Flutter | firstwhere error reporting
Generic mechanism and enhanced for loop
C language: deep analysis of const keyword
The postman test interface has 404 or 500 errors when the URL is configured correctly
SAP 电商云 Spartacus UI Store 相关的设计明细