新增下拉刷新
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import TabsComponents from '@/components/tabs/tabs.vue'
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import { onShow, onLoad, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { InspectionListType, getInspectionList } from '@/api/insepction.js'
|
||||
import { parseTime } from '@/utils/time.js'
|
||||
|
||||
@@ -129,6 +129,10 @@ function getlist() {
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
if (isRefresh) {
|
||||
uni.stopPullDownRefresh()
|
||||
isRefresh = false
|
||||
}
|
||||
isLoading.value = false
|
||||
})
|
||||
}
|
||||
@@ -155,6 +159,13 @@ onLoad(options => {
|
||||
activeValue.value = Number(options.type)
|
||||
})
|
||||
|
||||
// 是否正在下拉刷新
|
||||
let isRefresh = false
|
||||
onPullDownRefresh(() => {
|
||||
isRefresh = true
|
||||
init()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
handleTabs(activeValue.value)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user