AntDesignVue之a-bale

a-table API描述。


参数 说明 类型
pagination 分页器,参考配置项或 pagination文档,设为 false 时不展示和进行分页 Object

说明pagination是个对象或false.如果是对象,需要按分页文档进行配置。

pagination文档说明

参数 说明 类型
current(v-model) 当前页数 number
pageSize(v-model) 每页条数 number

代码示例

<a-table v-if="$auth('authRole.list')"
	size="small"
	:columns="columns"
	:rowKey="record => record.id"
	:pagination="queryParam"
	:dataSource="table1DataSource"
	@change="change"
	>
	<span slot="serial" slot-scope="text, record, index">{{ queryParam.pageSize*(queryParam.pageNum-1)+index + 1 }}</span>
	<span slot="parentVersion" slot-scope="text, record, index">
	   上级<br/>版
	</span>
	<span slot="action" slot-scope="text, record">
		<a href="javascript:void(0);" @click="show(record)"">显示什么</a>
	</span>
</a-table>
//查询按钮
handleSearch() {
	this.queryParam.pageNum = 1;
	this.queryParam.current = 1;//重点
	this.query();
},

// 分页操作
change(pagination, filters, sorter) {
	this.queryParam.pageSize = pagination.pageSize;
	this.queryParam.pageNum = pagination.current;
	this.queryParam.current = pagination.current;//重点
	this.query();
},

posted @ 2022-09-28 14:59  letmedown  阅读(137)  评论(0编辑  收藏  举报