Skip to content

Pagination 分页

分页组件,用于显示和操作分页数据,支持多种配置,包括尺寸、展示模式、页码类型等。

支持平台

安卓iosweb微信小程序支付宝小程序QQ小程序
xxx

示例

html
<template>
	<t-page title="分页" class='p.30'>
		<t-card class="mb.30" title="Pagination 分页" sub-title="数据量大,数据分页加载.."></t-card>
		<template v-if="area==1">
			<t-section title="默认+全部功能开启+主题展示" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="normal" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="primary" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="error" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="warning" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="success" :current="current"></t-pagination>
		</template>
		<template v-if="area==2">
			<t-section title="图标模式" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="normal" mode="2" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="primary" mode="2" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="error" mode="2" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="warning" mode="2" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="success" mode="2" :current="current"></t-pagination>
		</template>
		<template v-if="area==3">
			<t-section title="禁用首页未页按钮" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="normal" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="primary" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="error" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="warning" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30" :total="total" type="success" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current"></t-pagination>
		</template>
		<template v-if="area==4">
			<t-section title="禁用上一页下一页按钮" class="mb.30"></t-section>
			<t-pagination class="mb.30-h.70" :total="total" type="normal" mode="2" :showFirstButton="false"
				:showPreButton="false" :showNextButton="false" :showLastButton="false"
				:current="current"></t-pagination>
			<t-pagination class="mb.30-h.70" :total="total" type="primary" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current" :showPreButton="false"
				:showNextButton="false"></t-pagination>
			<t-pagination class="mb.30-h.70" :total="total" type="error" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current" :showPreButton="false"
				:showNextButton="false"></t-pagination>
			<t-pagination class="mb.30-h.70" :total="total" type="warning" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current" :showPreButton="false"
				:showNextButton="false"></t-pagination>
			<t-pagination class="mb.30-h.70" :total="total" type="success" mode="2" :showFirstButton="false"
				:showLastButton="false" :current="current" :showPreButton="false"
				:showNextButton="false"></t-pagination>
		</template>
		<template v-if="area==5">
			<t-section title="禁用首页未页按钮" class="mb.30"></t-section>
			<t-pagination class="mb.30-w.250" :total="total" type="normal" mode="2" pageType="1"
				:showFirstButton="false" :showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30-w.250" :total="total" type="primary" mode="2" pageType="1"
				:showFirstButton="false" :showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30-w.250" :total="total" type="error" mode="2" pageType="1" :showFirstButton="false"
				:showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30-w.250" :total="total" type="warning" mode="2" pageType="1"
				:showFirstButton="false" :showLastButton="false" :current="current"></t-pagination>
			<t-pagination class="mb.30-w.250" :total="total" type="success" mode="2" pageType="1"
				:showFirstButton="false" :showLastButton="false" :current="current"></t-pagination>
		</template>
		<template v-if="area==6">
			<t-section title="主题-尺寸-mini" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="primary" :current="current" size="mini"></t-pagination>
			<t-section title="主题-尺寸-small" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="error" :current="current" size="small"></t-pagination>
			<t-section title="主题-尺寸-medium" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="warning" :current="current" size="medium"></t-pagination>
			<t-section title="主题-尺寸-large" class="mb.30"></t-section>
			<t-pagination class="mb.30" :total="total" type="success" :current="current" size="large"></t-pagination>
		</template>
		<t-row class='ffww-tdb-tdr-tdp'>
			<t-button type="p" class="mr.30-mb.30" size="small" @click="area=1">默认+全部功能开启</t-button>
			<t-button type="e" class="mr.30-mb.30" size="small" @click="area=2">图标模式</t-button>
			<t-button type="s" class="mr.30-mb.30" size="small" @click="area=3">禁用首页未页按钮</t-button>
			<t-button type="w" class="mr.30-mb.30" size="small" @click="area=4">禁用上一页下一页按钮</t-button>
			<t-button type="p" class="mr.30-mb.30" size="small" @click="area=5">简约模式</t-button>
			<t-button type="e" class="mr.30-mb.30" size="small" @click="area=6">主题尺寸展示</t-button>
		</t-row>
	</t-page>
</template>

<script>
	export default {
		data() {
			return {
				area: 6,
				current: 15,
				total: 300,
			}
		},
		methods: {

		},
		onReady() {

		}
	}
</script>

Props

名称描述类型默认值
size分页组件的尺寸String'mini'
mode展示模式,1表示文字按钮,2表示图标按钮String'1'
type分页组件的类型String'p'
pageType页码展示类型,1表示简约型,2表示展开型String'2'
preText上一页的文本String'上一页'
nextText下一页的文本String'下一页'
showPreButton是否显示上一页按钮Booleantrue
showNextButton是否显示下一页按钮Booleantrue
current当前页码Number1
total数据总量Number0
pageSize每页数据量Number10
firstText首页的文本String'首页'
lastText末页的文本String'末页'
showFirstButton是否显示首页按钮Booleantrue
showLastButton是否显示末页按钮Booleantrue

Events

名称描述参数
change当前页码发生变化时触发当前页码