uniapp如何下拉重新整理?其實簡簡單單

2021-10-23 17:48:53 字數 514 閱讀 9020

第二步

話不多說,直接上乾貨

需要在pages.json檔案的globalstyle物件中開啟enablepulldownrefresh屬性,如圖:

在pages.json檔案中的pages陣列中找到對應的頁面,並在對應頁面的style屬性中開啟enablepulldownrefresh,如圖:

下拉重新整理功能開啟完後,就可以在指定頁面實現特定功能了

2.1指定頁面新增生命週期函式

使用下拉重新整理的時候,肯定得監聽使用者的下拉動作,所以就得在頁面中新增 onpulldownrefresh生命週期函式,然後在onpulldownrefresh生命週期函式中實現特定功能;

//希望能夠幫助到大家

uniapp 下拉重新整理

1 需要在pages.json裡,找到的當前頁面的pages節點,並在 style 選項中開啟enablepulldownrefresh。2 當處理完資料重新整理後,uni.stoppulldownrefresh可以停止當前頁面的下拉重新整理。在js中定義onpulldownrefresh處理函式 ...

uni app 下拉重新整理

官方文件 在 js 中定義 onpulldownrefresh 處理函式 和onload等生命週期函式同級 監聽該頁面使用者下拉重新整理事件。開始下拉重新整理,呼叫後觸發下拉重新整理動畫,效果與使用者手動下拉重新整理一致。object 引數說明 引數名型別 必填說明 success function...

uni app做下拉重新整理

onload option 1000 毫秒 uni.startpulldownrefresh this getbargindata 呼叫這個介面 console.log res success 返回引數說明 這裡表示當進入頁面的時候就開始執行下拉重新整理動畫 onpulldownrefresh th...