Skip to content
# t-loadmore

Loadmore 加载更多

t-loadmore 组件介绍 ​

加载更多组件,指示用户可以加载内容的状态,支持多种状态和装饰元素,并可配置尺寸和样式。

t-loadmore 平台兼容 ​

HarmonyH5AndroidiOS小程序UTS
✅✅✅✅✅✅

t-loadmore 基础用法 ​

基础用法参考 demo/loadmore/loadmore.uvue,支持状态、分割线、尺寸与主题配置。

vue
<template>
	<view>
		<tui-theme-switch></tui-theme-switch>
		<t-card class="mlrt-15"
				title="Loadmore 加载更多"
				sub-title="指示用户可以加载内容的状态,支持多种状态和装饰元素,并可配置尺寸和样式。"></t-card>
		<introduction title="基础功能+主题展示">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore></t-loadmore>
			</view>
		</introduction>
		<introduction title="线条类型">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore type="success"
							lineStyle='dashed'
							:line="true"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore type="primary"
							:line="true"></t-loadmore>
			</view>
		</introduction>
		<introduction title="状态">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore :line="true"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore type="success"
							:line="true"
							:status="3"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore type="primary"
							:line="true"
							:status="1"></t-loadmore>
			</view>
		</introduction>
		<introduction title="状态(无分割线)">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="medium"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="medium"
							type="success"
							:status="3"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="medium"
							type="error"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="medium"
							type="primary"
							:status="1"></t-loadmore>
			</view>
		</introduction>

		<!-- 补充的演示示例 -->
		<introduction title="尺寸演示">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="large"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="medium"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="small"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore size="mini"
							:status="2"></t-loadmore>
			</view>
		</introduction>

		<introduction title="禁用状态">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore :disabled="true"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore type="primary"
							:disabled="true"
							:status="1"></t-loadmore>
			</view>
		</introduction>

		<introduction title="点击效果">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore :hover="true"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore :hover="false"
							:status="2"></t-loadmore>
			</view>
		</introduction>

		<introduction title="主题效果">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore effect="normal"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore effect="dark"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore effect="light"
							:status="2"></t-loadmore>
			</view>
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore effect="plain"
							:status="2"></t-loadmore>
			</view>
		</introduction>

		<introduction title="跳转路径">
			<view class="r-10 p-10 mb-15 fc">
				<t-loadmore path="/pages/index/index"
							:status="2"></t-loadmore>
			</view>
		</introduction>
	</view>
</template>

<script setup>
</script>

t-loadmore Props ​

属性名类型默认值说明可选值
sizeString"medium"组件尺寸large, medium, small, mini
typeString"primary"组件类型info, primary, error, warning, success
disabledBooleanfalse组件是否禁用true, false
hoverBooleanfalse是否有点击效果true, false
pathString""点击组件后跳转的页面路径-
effectString"normal"组件显示主题normal, dark, light, plain
lineBooleanfalse是否显示分隔线true, false
lineClassString""分隔线样式-
lineStyleString"solid"分隔线类型solid, dashed, dotted, double
statusNumber1组件状态0: 加载前, 1: 加载中, 2: 没有更多
loadingClassString""加载中的图标样式-
loadmoreTextString"上拉加载更多"加载前的提示文本-
loadingTextString"加载中"加载中的提示文本-
nomoreTextString"页面有限,服务不止"没有更多的显示文本-

t-loadmore Events ​

事件名说明回调参数
click点击时触发-
transitionend动画结束时触发-
initFinished组件初始化完成触发组件的节点信息
touchstart触摸开始时触发触摸事件对象
touchend触摸结束时触发触摸事件对象
touchmove触摸移动时触发触摸事件对象
touchcancel触摸取消时触发触摸事件对象

Status 说明 ​

状态值说明显示文本
0加载前loadmoreText
1加载中loadingText
2没有更多nomoreText