uniapp组件-uni-pagination分页器

官方示例:https://ext.dcloud.net.cn/plugin?id=32

Pagination 分页器组件,用于展示页码、请求数据等。

一、基本属性

<template>
	<view>
		<uni-pagination :total="60"/>
		<uni-pagination :total="50" prev-text="前一页" next-text="后一页" />
		<uni-pagination :show-icon="true" :total="50" />
	</view>
</template>

二、绑定事件

<template>
	<view>
		<uni-pagination :current="current" :total="total" :show-icon="true" @change="change" />
		<text>当前页:{{ current }},数据总量:{{ total }}条,每页数据:{{ pageSize }}</text>
		<button  type="primary" @click="add">增加</button>
		<button  type="default" @click="reset">重置数据</button>
	</view>
</template>

<script>
export default {
	components: {},
	data() {
		return {
			current: 1,
			total: 0,
			pageSize: 10
		};
	},
	methods: {
		add() {
			this.total += 10;
		},
		reset() {
			this.total = 0;
			this.current = 1;
		},
		change(e) {
			this.current = e.current;
		}
	}
};
</script>

 


版权声明:本文为qq_40323256原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。