forked from ant-design/ant-design
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix the issue about throw a warning when Splitter nested in a hi…
…dden tab panel (ant-design#51109)
- Loading branch information
1 parent
1a8b252
commit e17d7c9
Showing
8 changed files
with
319 additions
and
1 deletion.
There are no files selected for viewing
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,7 @@ | ||
## zh-CN | ||
|
||
嵌套在标签页中。 | ||
|
||
## en-US | ||
|
||
Nested in tabs. |
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,54 @@ | ||
import React from 'react'; | ||
import { Flex, Splitter, Tabs, Typography } from 'antd'; | ||
|
||
const Desc: React.FC<Readonly<{ text?: string | number }>> = (props) => ( | ||
<Flex justify="center" align="center" style={{ height: '100%' }}> | ||
<Typography.Title type="secondary" level={5} style={{ whiteSpace: 'nowrap' }}> | ||
{props.text} | ||
</Typography.Title> | ||
</Flex> | ||
); | ||
|
||
const App: React.FC = () => { | ||
const SplitterContent = ( | ||
<Splitter | ||
style={{ | ||
height: 200, | ||
boxShadow: '0 0 10px rgba(0, 0, 0, 0.1)', | ||
}} | ||
> | ||
<Splitter.Panel collapsible> | ||
<Desc text={1} /> | ||
</Splitter.Panel> | ||
<Splitter.Panel | ||
collapsible={{ | ||
start: true, | ||
}} | ||
> | ||
<Desc text={2} /> | ||
</Splitter.Panel> | ||
<Splitter.Panel> | ||
<Desc text={3} /> | ||
</Splitter.Panel> | ||
</Splitter> | ||
); | ||
return ( | ||
<Tabs | ||
defaultActiveKey="1" | ||
items={[ | ||
{ | ||
key: '1', | ||
label: 'General', | ||
children: 'Content of Tab Pane 1', | ||
}, | ||
{ | ||
key: '2', | ||
label: 'Splitter Tab', | ||
children: SplitterContent, | ||
}, | ||
]} | ||
/> | ||
); | ||
}; | ||
|
||
export default App; |
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