mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #10967 from jinmingpang/fix-issue-10951
fix: #10951 修复 InputTable 在 配置 perPage 开启分页场景时,底部新增按钮展示异常
This commit is contained in:
commit
a751ede14e
@ -1941,6 +1941,13 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
offset = (page - 1) * perPage;
|
||||
}
|
||||
|
||||
// 底部新增按钮是否显示
|
||||
const footerAddBtnVisible =
|
||||
!isStatic &&
|
||||
addable &&
|
||||
showFooterAddBtn !== false &&
|
||||
(!maxLength || maxLength > this.state.items.length);
|
||||
|
||||
return (
|
||||
<div className={cx('InputTable', className)}>
|
||||
{render(
|
||||
@ -1983,13 +1990,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
testIdBuilder: testIdBuilder?.getChild('table')
|
||||
}
|
||||
)}
|
||||
{(!isStatic &&
|
||||
addable &&
|
||||
showFooterAddBtn !== false &&
|
||||
(!maxLength || maxLength > items.length)) ||
|
||||
showPager ? (
|
||||
{footerAddBtnVisible || showPager ? (
|
||||
<div className={cx('InputTable-toolbar', toolbarClassName)}>
|
||||
{addable && showFooterAddBtn !== false
|
||||
{footerAddBtnVisible
|
||||
? render(
|
||||
'button',
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user