|
@@ -18,8 +18,10 @@ const props = withDefaults(defineProps<{
|
|
|
total: 0,
|
|
total: 0,
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
const emit = defineEmits(['loadMore'])
|
|
const emit = defineEmits(['loadMore'])
|
|
|
|
|
+const loadMoreStatus = computed(() => {
|
|
|
|
|
+ return props.pagination.size > props.pagination.total ? 'nomore' : 'more'
|
|
|
|
|
+})
|
|
|
const contentText = ref<ContentText>({
|
|
const contentText = ref<ContentText>({
|
|
|
contentdown: '查看更多',
|
|
contentdown: '查看更多',
|
|
|
contentrefresh: '加载中',
|
|
contentrefresh: '加载中',
|
|
@@ -27,6 +29,9 @@ const contentText = ref<ContentText>({
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
function handleLoadMore() {
|
|
function handleLoadMore() {
|
|
|
|
|
+ if (props.pagination.size > props.pagination.total) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
emit('loadMore')
|
|
emit('loadMore')
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
@@ -50,7 +55,7 @@ function handleLoadMore() {
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <uni-load-more status="more" :content-text="contentText" @click-load-more="handleLoadMore" />
|
|
|
|
|
|
|
+ <uni-load-more :status="loadMoreStatus" :content-text="contentText" @click-load-more="handleLoadMore" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|