File tree 4 files changed +25
-14
lines changed
4 files changed +25
-14
lines changed Original file line number Diff line number Diff line change 1
1
# 更新日志
2
2
3
+ ### 2.3.9
4
+ - [ +] TableList 增加 hideEmptyTable 属性
5
+
3
6
### 2.3.8
4
7
- [ !] 修复 schema 多层嵌套下,getSchemaByPath 获取异常
5
8
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " form-render" ,
3
- "version" : " 2.3.8 " ,
3
+ "version" : " 2.3.9 " ,
4
4
"description" : " 通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成" ,
5
5
"keywords" : [
6
6
" Form" ,
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ interface ListTableProps {
18
18
/*
19
19
* 没有数据时是否隐藏表格
20
20
*/
21
- hideTableWhenNoData ?: boolean ;
21
+ hideEmptyTable ?: boolean ;
22
22
[ key : string ] : any ;
23
23
} ;
24
24
@@ -61,8 +61,7 @@ const TableList: React.FC<ListTableProps> = (props) => {
61
61
hideMove,
62
62
hideAdd,
63
63
hideOperate,
64
- hideTableWhenNoData,
65
-
64
+ hideEmptyTable,
66
65
addItem,
67
66
copyItem,
68
67
moveItem,
@@ -188,7 +187,7 @@ const TableList: React.FC<ListTableProps> = (props) => {
188
187
} ) ;
189
188
}
190
189
191
- const showTable = fields . length > 0 ? true : ! hideTableWhenNoData ;
190
+ const showTable = fields . length > 0 ? true : ! hideEmptyTable ;
192
191
193
192
return (
194
193
< div className = { classnames ( 'fr-table-list' , { 'fr-table-list-no-popover' : ! islidatePopover } ) } >
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ interface ListVirtualProps {
16
16
delConfirmProps : any ;
17
17
renderCore : any ;
18
18
rootPath : any ;
19
+ /*
20
+ * 没有数据时是否隐藏表格
21
+ */
22
+ hideEmptyTable ?: boolean ;
19
23
[ key : string ] : any ;
20
24
} ;
21
25
@@ -58,6 +62,7 @@ const VirtualList: React.FC<ListVirtualProps> = (props) => {
58
62
hideMove,
59
63
hideAdd,
60
64
hideOperate,
65
+ hideEmptyTable,
61
66
62
67
addItem,
63
68
copyItem,
@@ -180,17 +185,21 @@ const VirtualList: React.FC<ListVirtualProps> = (props) => {
180
185
} ) ;
181
186
}
182
187
188
+ const showTable = fields . length > 0 ? true : ! hideEmptyTable ;
189
+
183
190
return (
184
191
< >
185
- < Table
186
- className = { classnames ( 'fr-virtual-list' , { 'fr-virtual-list-no-popover' : ! islidatePopover } ) }
187
- size = 'middle'
188
- columns = { columns }
189
- dataSource = { fields }
190
- pagination = { false }
191
- scroll = { { y : scrollY } }
192
- components = { vt }
193
- />
192
+ { showTable && (
193
+ < Table
194
+ className = { classnames ( 'fr-virtual-list' , { 'fr-virtual-list-no-popover' : ! islidatePopover } ) }
195
+ size = 'middle'
196
+ columns = { columns }
197
+ dataSource = { fields }
198
+ pagination = { false }
199
+ scroll = { { y : scrollY } }
200
+ components = { vt }
201
+ />
202
+ ) }
194
203
{ ( ! schema . max || fields . length < schema . max ) && ! hideAdd && (
195
204
< Button
196
205
icon = { < PlusOutlined /> }
You can’t perform that action at this time.
0 commit comments