-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Description
- I have searched the issues of this repository and believe that this is not a duplicate.
Version
1.7.7
Environment
vue2
Reproduction link
Steps to reproduce
<template>
<div>
<a-table :columns="columns" :data-source="data" :pagination="pagination">
</a-table>
<hr />
<hr />
<hr />
<a-table :columns="columns" :data-source="dataB" :pagination="pagination">
</a-table>
</div>
</template>
<script>
export default {
data(){
return {
data: [],
dataB: [{id:1}],
columns: [{
title: 'id',
dataIndex: 'id',
key: 'id',
},],
pagination: {
size: 'small',
position: 'bottom',
total: 0,
pageSize: 10,
current: 1,
showSizeChanger: true,
showQuickJumper: true,
hideOnSinglePage: false,
pageSizeOptions: ['5', '10', '20', '30', '40'],
showTotal(total) {
console.log(total)
return `共 ${total} 条`
}
}
}
},
methods: {
},
};
</script>What is expected?
开启 pagination 后 total 为 0 也能展示分页栏
What is actually happening?
table 配置分页 pagination,当 total 为 0 时 分页栏会消失,高度会发生变化
因为项目的pagination position 都是top,然后为了美观,pagination 左边都会定位放置一个按钮,分页栏消失会导致按钮位置显示错误