新增下拉刷新
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onShow, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import TabsComponents from '@/components/tabs/tabs.vue'
|
||||
import { getReplaceMainList } from '@/api/instrument.js'
|
||||
|
||||
@@ -138,12 +138,23 @@ function getlist() {
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
if (isRefresh) {
|
||||
isRefresh = false
|
||||
uni.stopPullDownRefresh()
|
||||
}
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
resetList()
|
||||
})
|
||||
|
||||
// 是否正在下拉刷新
|
||||
let isRefresh = false
|
||||
onPullDownRefresh(() => {
|
||||
isRefresh = true
|
||||
resetList()
|
||||
})
|
||||
|
||||
// 重置
|
||||
function resetList() {
|
||||
infolist.value = []
|
||||
|
||||
Reference in New Issue
Block a user