From 0120008cbdbc8c567d1c8204a0cd7e786dcf7275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Tue, 21 Feb 2017 14:43:48 +0800 Subject: [PATCH] Add tabBarStyle, close #4966 (#4970) --- components/tabs/index.en-US.md | 1 + components/tabs/index.tsx | 3 +++ components/tabs/index.zh-CN.md | 1 + 3 files changed, 5 insertions(+) diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index 672354b2fc..b110599aa9 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -25,6 +25,7 @@ Ant Design has 3 types Tabs for different situation. | onChange | Callback when tab is switched | Function | - | | onTabClick | Callback when tab is clicked | Function | - | | tabBarExtraContent | Extra element in tab bar | React.ReactNode | - | +| tabBarStyle | tar bar style object | object | - | | type | Basic style of tabs. Options: line, card & editable-card | string | line | | size | Tab bar size. Options: default, small. Only works while `type="line"`. | string | default | | tabPosition | Position of tabs. Options: top, right, bottom & left | string | top | diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index 676262eae9..85d90d8318 100755 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -19,6 +19,7 @@ export interface TabsProps { onChange?: (activeKey: string) => void; onTabClick?: Function; tabBarExtraContent?: React.ReactNode | null; + tabBarStyle?: React.CSSProperties; type?: TabsType; tabPosition?: TabsPosition; onEdit?: (targetKey: string, action: any) => void; @@ -91,6 +92,7 @@ export default class Tabs extends React.Component { tabPosition, children, tabBarExtraContent, + tabBarStyle, hideAdd, onTabClick, animated, @@ -150,6 +152,7 @@ export default class Tabs extends React.Component { ); diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index 271d93e383..e5382eb326 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -28,6 +28,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | onChange | 切换面板的回调 | Function | 无 | | onTabClick | tab 被点击的回调 | Function | 无 | | tabBarExtraContent | tab bar 上额外的元素 | React.ReactNode | 无 | +| tabBarStyle | tar bar 的样式对象 | object | - | | type | 页签的基本样式,可选 `line`、`card` `editable-card` 类型 | string | 'line' | | size | 大小,提供 `default` 和 `small` 两种大小,仅当 `type="line"` 时生效。 | string | 'default' | | tabPosition | 页签位置,可选值有 `top` `right` `bottom` `left` | string | 'top' |