当前位置:网站首页>scroll-view實現下拉刷新(避免onload進入頁面初始refresher-triggered為true觸發下拉問題)
scroll-view實現下拉刷新(避免onload進入頁面初始refresher-triggered為true觸發下拉問題)
2022-07-24 00:53:00 【路光.】
避免初始進入頁面由於要將refresher-triggered為true才可正常使用下拉加載問題
<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(){
},
}關鍵代碼:
onLoad(){
//設置一個控制開啟自定義下拉刷新開關
this.isRefresher=false;
let t=setTimeout(() => {
clearTimeout(t);
this.triggered = true;
}, 1000)
let ts=setTimeout(()=>{
clearTimeout(ts);
this.isRefresher=true;
},3000)
},
边栏推荐
- The way to access global variables in multi-source file mode (extern usage)
- 测试小码农也有大目标,最新BAT大厂面试题大总结(持续更新中...)
- 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
- Tutorial on the principle and application of database system (044) -- MySQL query (VI): using the limit option to realize paging query
- 網絡系統實驗:ping不通的問題解决
- Résumé du websocket minier
- Fpga:ov7725 camera displays images in rgb565 format through vga/hdmi
- Treatment of particle boundary collision
- High number_ Chapter 1 space analytic geometry and vector algebra__ Two point distance
- An article teaches you the basic use of kubernetes
猜你喜欢

How can dbcontext support the migration of different databases in efcore advanced SaaS system

Small farmers also have big goals in the test, and the latest big bat interview summary (constantly updating...)

Network system experiment: solve the problem of Ping failure

Implementation of singleton mode in C #

Bert article translation

Classic example of C language - print the input two digits in reverse order

Classic examples of C language - adding two scores

Creo 9.0 mouse button operation for model observation

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

Coloring old photos - deoldify get started quickly
随机推荐
JS determines whether the element scrolls to the top
A good habit to develop when writing SQL
采坑websocket总结
Tutorial on the principle and application of database system (046) -- MySQL query (VIII): group by
Installation and use of appscan
测试小码农也有大目标,最新BAT大厂面试题大总结(持续更新中...)
NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘
Educational Codeforces Round 132 (Rated for Div. 2) D. Rorororobot
Okaleido tiger NFT is about to log in to the binance NFT platform. Are you looking forward to it?
Coloring old photos - deoldify get started quickly
通信模块整理(二)HC-05
High number_ Chapter 2 differential calculus of multivariate functions__ Geometric application of partial derivatives_ Tangent and normal plane of space curve
Customize an object
C language book recommendation
【数据挖掘工程师-笔试】2022年海尔 公司
Summary of polynomial commitment schemes
Dark horse programmer - interface test - four day learning interface test - day 4 - postman reads external data files, reads data files, IHRM project practice, employee management module, adds employe
黑馬程序員-接口測試-四天學習接口測試-第四天-Postman讀取外部數據文件,讀取數據文件數據,iHRM項目實戰,員工管理模塊,添加員工,批量運行測試用例,生成測試報告,
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
MySQL data query (select)