|
@@ -37,6 +37,7 @@ const statusList = [0, 1, 3, 98]
|
|
|
|
|
|
const more = ref('more')
|
|
|
const items = ref([])
|
|
|
+const total = ref(0)
|
|
|
const queryParams = ref({
|
|
|
pageNo: 1,
|
|
|
pageSize: 10
|
|
@@ -69,7 +70,8 @@ const getList = async () => {
|
|
|
})
|
|
|
items.value = items.value.concat(list)
|
|
|
}
|
|
|
- more.value = items.value?.length === +data.total ? 'noMore' : 'more'
|
|
|
+ total.value = data?.total || 0
|
|
|
+ more.value = items.value?.length === total.value ? 'noMore' : 'more'
|
|
|
}
|
|
|
|
|
|
const handleChange = (e) => {
|
|
@@ -81,6 +83,7 @@ const handleChange = (e) => {
|
|
|
|
|
|
// 加载更多
|
|
|
const loadingMore = () => {
|
|
|
+ if (total.value <= 0) return
|
|
|
more.value = 'loading'
|
|
|
queryParams.value.pageNo++
|
|
|
getList()
|