Skip to content

Commit

Permalink
style: #563 tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxy0551 committed Apr 30, 2024
1 parent 8ee045b commit da5be0c
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/tab/demo/card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 4
order: 5
title:
zh-CN: 卡片式页签
en-US: Card type tab
Expand Down
2 changes: 1 addition & 1 deletion components/tab/demo/editable-card.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 7
order: 8
title:
zh-CN: 新增和关闭页签
---
Expand Down
2 changes: 1 addition & 1 deletion components/tab/demo/light.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 5
order: 6
title:
zh-CN: 浅色背景下使用
---
Expand Down
2 changes: 1 addition & 1 deletion components/tab/demo/sider-menu.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
order: 6
order: 7
title:
zh-CN: 侧边菜单
---
Expand Down
43 changes: 43 additions & 0 deletions components/tab/demo/slide-vertical.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
order: 4
title:
zh-CN: 左侧使用
en-US: SlideLeft
---

## zh-CN

可以使用 `dt-tabs-hidden-more-icon` 隐藏数量较多时左下角或右上角的 `···` icon

## en-US

You can use 'dt-tabs-hidden-more-icon' to hide the more icon in the bottom left or top right corner when there is a large quantity.

```jsx
import { Tabs, Radio } from 'antd';
import { AndroidOutlined, AppleOutlined } from '@ant-design/icons';

const { TabPane } = Tabs;

class SlidingTabsDemo extends React.Component {
constructor(props) {
super(props);
}

render() {
return (
<div>
<Tabs className="dt-tabs-hidden-more-icon" defaultActiveKey="1" tabPosition="left" style={{ height: 220 }}>
{[...Array(30).keys()].map(i => (
<TabPane tab={ i < 4 ? <span><AndroidOutlined />Tab-{i}</span> : `Tab-${i}`} key={i}>
Content of tab {i}
</TabPane>
))}
</Tabs>
</div>
);
}
}

ReactDOM.render(<SlidingTabsDemo />, mountNode);
```
3 changes: 2 additions & 1 deletion components/tab/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/lkI2hNEDr2V/Tabs.svg
|.dt-tabs-sider-menu | 侧边栏菜单类名,需配合type="line"和tabPosition="right"或者"left"一起使用 | 侧边菜单 |
|.dt-tabs-content-padding | 内容内边距类名,16px | 侧边菜单 |
|.dt-tabs-nav-padding-16 | 增加左右边距16px | 基础样式 |
|.dt-tabs-nav-no-margin | 减少上边距/左边距16px,整体宽度增加32px | 消除间隙 |
|.dt-tabs-nav-no-margin | 减少上边距/左边距16px,整体宽度增加32px | 消除间隙 |
|.dt-tabs-hidden-more-icon | 更多标签时,隐藏 ··· 的更多 icon | 侧边菜单 |
11 changes: 9 additions & 2 deletions theme/dt-theme/default/tab.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
line-height: 20px;
.ant-tabs-tab-btn {
.anticon {
margin-right: 4px;
margin: 0 4px 0 -4px;
font-size: 16px;
color: @black_pageMsg;
}
Expand Down Expand Up @@ -119,7 +119,8 @@
.ant-tabs-nav-wrap-ping-bottom {
.ant-tabs-nav-list {
.ant-tabs-tab {
padding: 8px 12px;
padding: 2px 12px;
margin: 6px 0;
}
}
}
Expand Down Expand Up @@ -203,6 +204,12 @@
}
}

.dt-tabs-hidden-more-icon {
.ant-tabs-nav-more {
display: none;
}
}

.ant-tabs-right.dt-tabs-sider-menu {
.ant-tabs-nav {
.ant-tabs-tab-active {
Expand Down

0 comments on commit da5be0c

Please sign in to comment.