Skip to content

Commit 75be018

Browse files
committed
doc: add table faq #4970
close #4970
1 parent bde5772 commit 75be018

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

components/table/index.en-US.md

+18
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,21 @@ return <Table rowKey={record => record.uid} />;
280280
Table deprecated `column.slots`, added `v-slot:bodyCell`, `v-slot:headerCell`, custom cells, and added `column.customFilterDropdown` `v-slot:customFilterDropdown`, custom filtering Menu, added `v-slot:customFilterIcon` custom filter button, but `column.slots` is still available, we will remove it in the next major version.
281281

282282
Besides, the breaking change is changing `dataIndex` from nest string path like `user.age` to string array path like `['user', 'age']`. This help to resolve developer should additional work on the field which contains `.`.
283+
284+
## FAQ
285+
286+
### How to hide pagination when single page or no data?
287+
288+
You can set `hideOnSinglePage` with `pagination` prop.
289+
290+
### Table will return to first page when filter data.
291+
292+
Table total page count usually reduce after filter data, we defaultly return to first page in case of current page is out of filtered results.
293+
294+
### Why Table pagination show size changer?
295+
296+
In order to improve user experience, Pagination show size changer by default when `total > 50` since `3.0`. You can set `showSizeChanger=false` to disable this feature.
297+
298+
### How to handle fixed column display over the mask layout?
299+
300+
Fixed column use `z-index` to make it over other columns. You will find sometime fixed columns also over your mask layout. You can set `z-index` on your mask layout to resolve.

components/table/index.zh-CN.md

+20
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,23 @@ return <Table rowKey={record => record.uid} />;
286286
Table 废弃了 `column.slots`, 新增 `v-slot:bodyCell``v-slot:headerCell`,自定义单元格,新增 `column.customFilterDropdown` `v-slot:customFilterDropdown`,自定义筛选菜单,新增了 `v-slot:customFilterIcon` 自定义筛选按钮,但 `column.slots` 还可用,我们会在下一个大版本时移除。
287287

288288
此外,比较重大的改动为 `dataIndex` 从支持路径嵌套如 `user.age` 改成了数组路径如 `['user', 'age']`。以解决过去属性名带 `.` 需要额外的数据转化问题。
289+
290+
## FAQ
291+
292+
### 如何在没有数据或只有一页数据时隐藏分页栏
293+
294+
你可以设置 `pagination``hideOnSinglePage` 属性为 `true`
295+
296+
### 表格过滤时会回到第一页?
297+
298+
前端过滤时通常条目总数会减少,从而导致总页数小于筛选前的当前页数,为了防止当前页面没有数据,我们默认会返回第一页。
299+
300+
如果你在使用远程分页,很可能需要保持当前页面,你可以手动控制当前页面不变。
301+
302+
### 表格分页为何会出现 size 切换器?
303+
304+
`3.0` 起,Pagination 在 `total` 大于 50 条时会默认显示 size 切换器以提升用户交互体验。如果你不需要该功能,可以通过设置 `showSizeChanger``false` 来关闭。
305+
306+
### 固定列穿透到最上层该怎么办?
307+
308+
固定列通过 `z-index` 属性将其悬浮于非固定列之上,这使得有时候你会发现在 Table 上放置遮罩层时固定列会被透过的情况。为遮罩层设置更高的 `z-index` 覆盖住固定列即可。

0 commit comments

Comments
 (0)