-
-
Notifications
You must be signed in to change notification settings - Fork 46.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: use flex gap when supported * test: update snapshot * refactor: Use single hooks
- Loading branch information
Showing
6 changed files
with
140 additions
and
18 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
components/grid/hooks/useFlexGapSupport.tsx → components/_util/hooks/useFlexGapSupport.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
order: 99 | ||
title: | ||
zh-CN: Flex gap 样式 | ||
en-US: Flex gap style | ||
debug: true | ||
--- | ||
|
||
## zh-CN | ||
|
||
Debug usage | ||
|
||
## en-US | ||
|
||
Debug usage | ||
|
||
```tsx | ||
import { Space, Switch } from 'antd'; | ||
|
||
const style: React.CSSProperties = { | ||
width: 150, | ||
height: 100, | ||
background: 'red', | ||
}; | ||
|
||
const Demo = () => { | ||
const [singleCol, setSingleCol] = React.useState(false); | ||
|
||
return ( | ||
<> | ||
<Switch | ||
checked={singleCol} | ||
onChange={() => { | ||
setSingleCol(!singleCol); | ||
}} | ||
/> | ||
<Space style={{ width: singleCol ? 307 : 310, background: 'blue' }} size={[8, 8]} wrap> | ||
<div style={style} /> | ||
<div style={style} /> | ||
<div style={style} /> | ||
<div style={style} /> | ||
</Space> | ||
</> | ||
); | ||
}; | ||
|
||
ReactDOM.render(<Demo />, mountNode); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters