2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 10
|
2017-03-13 11:13:12 +08:00
|
|
|
title:
|
2016-08-23 14:15:34 +08:00
|
|
|
zh-CN: 卡片式页签容器
|
|
|
|
en-US: Container of card type Tab
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2016-08-23 14:15:34 +08:00
|
|
|
|
2016-08-03 10:39:20 +08:00
|
|
|
## zh-CN
|
2015-12-17 12:33:34 +08:00
|
|
|
|
2015-12-17 13:44:04 +08:00
|
|
|
用于容器顶部,需要一点额外的样式覆盖。
|
2015-12-17 12:33:34 +08:00
|
|
|
|
2016-08-03 10:39:20 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Should be used at the top of container, needs to override styles.
|
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```jsx
|
2015-12-17 12:33:34 +08:00
|
|
|
import { Tabs } from 'antd';
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2019-05-27 21:32:45 +08:00
|
|
|
const { TabPane } = Tabs;
|
2015-12-17 12:33:34 +08:00
|
|
|
|
|
|
|
ReactDOM.render(
|
2016-04-29 12:13:27 +08:00
|
|
|
<div className="card-container">
|
|
|
|
<Tabs type="card">
|
2017-06-26 20:20:57 +08:00
|
|
|
<TabPane tab="Tab Title 1" key="1">
|
|
|
|
<p>Content of Tab Pane 1</p>
|
|
|
|
<p>Content of Tab Pane 1</p>
|
|
|
|
<p>Content of Tab Pane 1</p>
|
|
|
|
</TabPane>
|
|
|
|
<TabPane tab="Tab Title 2" key="2">
|
|
|
|
<p>Content of Tab Pane 2</p>
|
|
|
|
<p>Content of Tab Pane 2</p>
|
|
|
|
<p>Content of Tab Pane 2</p>
|
|
|
|
</TabPane>
|
|
|
|
<TabPane tab="Tab Title 3" key="3">
|
|
|
|
<p>Content of Tab Pane 3</p>
|
|
|
|
<p>Content of Tab Pane 3</p>
|
|
|
|
<p>Content of Tab Pane 3</p>
|
|
|
|
</TabPane>
|
2016-04-29 12:13:27 +08:00
|
|
|
</Tabs>
|
2018-06-27 15:55:04 +08:00
|
|
|
</div>,
|
2019-05-07 14:57:32 +08:00
|
|
|
mountNode,
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2015-12-17 12:33:34 +08:00
|
|
|
|
2019-05-07 14:57:32 +08:00
|
|
|
```css
|
2020-04-28 11:16:01 +08:00
|
|
|
.card-container p {
|
|
|
|
margin: 0;
|
|
|
|
}
|
2016-05-10 11:26:48 +08:00
|
|
|
.card-container > .ant-tabs-card > .ant-tabs-content {
|
2015-12-17 12:33:34 +08:00
|
|
|
height: 120px;
|
|
|
|
margin-top: -16px;
|
|
|
|
}
|
2020-04-28 11:16:01 +08:00
|
|
|
[data-theme='compact'] .card-container > .ant-tabs-card > .ant-tabs-content {
|
|
|
|
height: 120px;
|
|
|
|
margin-top: -8px;
|
|
|
|
}
|
2016-04-06 11:49:02 +08:00
|
|
|
|
2020-03-29 10:39:46 +08:00
|
|
|
[data-theme='compact'] .card-container > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane,
|
2016-09-18 10:12:21 +08:00
|
|
|
.card-container > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane {
|
|
|
|
background: #fff;
|
|
|
|
padding: 16px;
|
|
|
|
}
|
|
|
|
|
2020-03-29 10:39:46 +08:00
|
|
|
[data-theme='compact'] .card-container > .ant-tabs-card > .ant-tabs-bar,
|
2017-06-26 20:20:57 +08:00
|
|
|
.card-container > .ant-tabs-card > .ant-tabs-bar {
|
|
|
|
border-color: #fff;
|
|
|
|
}
|
|
|
|
|
2020-03-29 10:39:46 +08:00
|
|
|
[data-theme='compact'] .card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab,
|
2016-06-17 15:45:48 +08:00
|
|
|
.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab {
|
|
|
|
border-color: transparent;
|
2017-06-26 20:20:57 +08:00
|
|
|
background: transparent;
|
2016-06-17 15:45:48 +08:00
|
|
|
}
|
|
|
|
|
2020-03-29 10:39:46 +08:00
|
|
|
[data-theme='compact'] .card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active,
|
2016-05-10 11:26:48 +08:00
|
|
|
.card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
|
2015-12-17 12:33:34 +08:00
|
|
|
border-color: #fff;
|
2017-06-26 20:20:57 +08:00
|
|
|
background: #fff;
|
2015-12-17 12:33:34 +08:00
|
|
|
}
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|
2017-06-26 20:20:57 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
#components-tabs-demo-card-top .code-box-demo {
|
|
|
|
background: #F5F5F5;
|
|
|
|
overflow: hidden;
|
|
|
|
padding: 24px;
|
|
|
|
}
|
2020-04-28 11:16:01 +08:00
|
|
|
|
2019-12-25 17:16:53 +08:00
|
|
|
[data-theme="dark"] .card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab {
|
|
|
|
border-color: transparent;
|
|
|
|
background: transparent;
|
|
|
|
}
|
2019-12-24 20:58:42 +08:00
|
|
|
[data-theme="dark"] #components-tabs-demo-card-top .code-box-demo {
|
|
|
|
background: #000;
|
|
|
|
}
|
|
|
|
[data-theme="dark"] .card-container > .ant-tabs-card > .ant-tabs-content > .ant-tabs-tabpane {
|
|
|
|
background: #141414;
|
|
|
|
}
|
|
|
|
[data-theme="dark"] .card-container > .ant-tabs-card > .ant-tabs-bar {
|
|
|
|
border-color: #141414;
|
|
|
|
}
|
|
|
|
[data-theme="dark"] .card-container > .ant-tabs-card > .ant-tabs-bar .ant-tabs-tab-active {
|
2019-12-25 17:16:53 +08:00
|
|
|
border-color: #141414;
|
2019-12-24 20:58:42 +08:00
|
|
|
background: #141414;
|
|
|
|
}
|
2017-06-26 20:20:57 +08:00
|
|
|
</style>
|