image.png
<a-table :pagination="pagination"></a-table>
export default {
components: {},
data() {
return {
pagination: {
pageNo: 1,
pageSize: 10, // 默认每页显示数量
showSizeChanger: true, // 显示可改变每页数量
pageSizeOptions: ["10", "20", "50", "100"], // 每页数量选项
showTotal: total => `共${total}条`, // 显示总数
onShowSizeChange: (pageSize) =>(this.pageSize = pageSize), // 改变每页数量时更新显示
onChange:this.onPageChange.bind(this), //点击页码事件
total: 0, //总条数
current: 0,
buildOptionText:pageSizeOptions => `${pageSizeOptions.value}条/页`,
// size: "small",
},
};
},
methods: {
onPageChange(page){
this.pagination.current=page;
}
}
}
网友评论