File tree 2 files changed +10
-14
lines changed
client/packages/lowcoder-design/src/components
2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 1
- import { Collapse as AntdCollapse } from "antd" ;
1
+ import { Collapse as AntdCollapse , CollapseProps } from "antd" ;
2
2
import { ReactComponent as UnFold } from "icons/icon-unfold.svg" ;
3
3
import { ReactComponent as Folded } from "icons/icon-folded.svg" ;
4
4
import { ReactComponent as Omit } from "icons/icon-omit.svg" ;
@@ -98,6 +98,12 @@ export const Collapse = (props: Iprops) => {
98
98
// setColor(keys.length ? "#F2F7FC" : "");
99
99
// onChange && onChange(keys);
100
100
// };
101
+ const collapseItems :CollapseProps [ 'items' ] = config . map ( ( item ) => ( {
102
+ key : item . key ,
103
+ label : item . title ,
104
+ children : item . data ,
105
+ } ) )
106
+
101
107
return (
102
108
// <Contain $color={props.isSelected || Color!==""}>
103
109
< Container optColor = { props . isSelected } simple = { props . simple } className = { props . className } >
@@ -106,19 +112,8 @@ export const Collapse = (props: Iprops) => {
106
112
expandIcon = { getExpandIcon }
107
113
defaultActiveKey = { props . isOpen ? [ props . config [ 0 ] . key ] : [ ] }
108
114
// onChange={handlechange}
109
- >
110
- { config && config . length > 0
111
- ? config . map ( ( item , index ) => {
112
- return (
113
- < React . Fragment key = { index } >
114
- < Panel header = { item . title } key = { item . key } showArrow = { true } >
115
- { item . data }
116
- </ Panel >
117
- </ React . Fragment >
118
- ) ;
119
- } )
120
- : null }
121
- </ AntdCollapse >
115
+ items = { collapseItems }
116
+ />
122
117
</ Container >
123
118
) ;
124
119
} ;
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ const CustomPopover = (props: {
98
98
) ;
99
99
return (
100
100
< Popover
101
+ overlayInnerStyle = { { padding : 0 } }
101
102
content = { contentWithBox }
102
103
trigger = "click"
103
104
open = { visible }
You can’t perform that action at this time.
0 commit comments