Loadmore
17:06Description
A loading-state indicator for the bottom of a page, offering three states: loadmore (before loading, tappable), loading (loading) and nomore (no more data). The loadmore / nomore states render divider lines on both sides of the text; text, colors and the loading icon type are all configurable.
Compatibility
| Platform | Support |
|---|---|
| App | ✅ Supported (the flower icon of the loading state inherits from ux-loading and renders as a solid dot on App) |
| H5 | ✅ Supported |
| WeChat Mini Program | ✅ Supported |
Examples
Load More
When status=loadmore, clicking triggers the loadmore event.
View source
vue
<template>
<ux-loadmore status="loadmore" @loadmore="onLoadMore" />
</template>
<script setup lang="uts">
function onLoadMore(): void {
uni.showToast({ title: '加载更多', icon: 'none' });
}
</script>Loading
When status=loading, shows loading animation and text.
View source
vue
<template>
<ux-loadmore status="loading" />
</template>No More
When status=nomore, shows no more data message.
View source
vue
<template>
<ux-loadmore status="nomore" />
</template>Dot Style
When is-dot=true, nomore state shows a dot.
View source
vue
<template>
<ux-loadmore status="nomore" :is-dot="true" />
</template>Custom Color
Customize text and icon color via color and icon-color.
View source
vue
<template>
<ux-loadmore status="loading" color="#fa3534" icon-color="#fa3534" />
</template>API
Props
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
customStyle | Custom root element style | UTSJSONObject | - | - |
customClass | Custom root element style class | string | '' | - |
bgColor | Component background color | string | '' | - |
icon | Whether to show the loading icon (default true) | boolean | true | - |
fontSize | Font size | string | '14' | - |
color | Font color | string | '' | - |
status | Component state: loadmore – before loading, loading – loading, nomore – no more (default loadmore) | string | 'loadmore' | - |
iconType | Icon of the loading state: flower – flower-shaped, circle – ring-shaped (default circle) | string | 'circle' | - |
loadText | Text to display | LoadmoreText | - | - |
isDot | Whether to show a dot in the "no more" state (default false) | boolean | false | - |
iconColor | Color of the spinning animation shown while loading | string | '' | - |
marginTop | Top margin | number | string | 0 | - |
marginBottom | Bottom margin | number | string | 0 | - |
height | Height, in px | number | string | 'auto' | - |
Events
| Event | Description | Params | Version |
|---|---|---|---|
loadmore | Emitted when the component is tapped while status is loadmore | - | - |
Slots
ux-loadmore has no slots.
Notes
- The
loadmoreevent is emitted only whenstatus="loadmore"; moreover the click handler is bound to the text, so tapping the side dividers or the icon area does not trigger it. load-textoverrides only partially: just the non-empty fields (loadmore/loading/nomore) replace the corresponding copy, and the rest falls back to the component's built-in i18n text.icononly controls whether the loading icon appears in theloadingstate;icon-type(circle/flower) is likewise effective only in theloadingstate.is-dotreplaces the text with "●" only in thenomorestate and leaves other states untouched.- The
loadmore/nomorestates renderux-linedividers on both sides of the text, while theloadingstate shows no dividers. margin-top/margin-bottom/heighttreat numeric values as px (run throughaddUnit);height: 'auto'means the height adapts to the content.- The component has no slots and no events other than
loadmore.