Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 406366c

Browse files
committed
✨ feat: 新增 hidden api
1 parent bf0b0b2 commit 406366c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/layout-kit/src/Flexbox.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export interface IFlexbox {
2424
width?: number | string;
2525
height?: number | string;
2626
padding?: string | number | CommonSpaceNumber;
27+
/**
28+
* 是否隐藏内容
29+
*/
30+
hidden?: boolean;
2731
}
2832

2933
export type FlexboxProps = IFlexbox &
@@ -32,7 +36,9 @@ export type FlexboxProps = IFlexbox &
3236
export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
3337
className: 'layoutkit-flexbox',
3438
}))<IFlexbox>`
35-
display: flex;
39+
// 是否显示
40+
display: ${(props) => (props.hidden ? 'none' : 'flex')};
41+
3642
flex-direction: ${(props) => {
3743
return getFlexDirection(props.direction, props.horizontal);
3844
}};

0 commit comments

Comments
 (0)