From 9c52014585f918a3bd37dabf6468e11ebe6f54ac Mon Sep 17 00:00:00 2001 From: lixiaoyang1992 Date: Sun, 17 Dec 2017 23:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BATabs=E5=A2=9E=E5=8A=A0gutter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/tabs/__tests__/__snapshots__/index.test.js.snap | 5 +++++ components/tabs/index.en-US.md | 1 + components/tabs/index.tsx | 3 +++ components/tabs/index.zh-CN.md | 1 + package.json | 2 +- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/tabs/__tests__/__snapshots__/index.test.js.snap b/components/tabs/__tests__/__snapshots__/index.test.js.snap index ac864adf58..cbff9960bc 100644 --- a/components/tabs/__tests__/__snapshots__/index.test.js.snap +++ b/components/tabs/__tests__/__snapshots__/index.test.js.snap @@ -101,6 +101,11 @@ exports[`Tabs tabPosition remove card 1`] = ` key="1" onClick={[Function]} role="tab" + style={ + Object { + "marginRight": undefined, + } + } > foo diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index e5aca94121..e652483a23 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -35,6 +35,7 @@ Ant Design has 3 types of Tabs for different situations. | onNextClick | Callback executed when next button is clicked | Function | - | | onPrevClick | Callback executed when prev button is clicked | Function | - | | onTabClick | Callback executed when tab is clicked | Function | - | +| tabBarGutter | The gap between tabs | number | - | ### Tabs.TabPane diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index 20dd55eef9..4e400a6928 100755 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -29,6 +29,7 @@ export interface TabsProps { prefixCls?: string; className?: string; animated?: boolean | { inkBar: boolean; tabPane: boolean; }; + tabBarGutter?: number; } // Tabs @@ -99,6 +100,7 @@ export default class Tabs extends React.Component { onPrevClick, onNextClick, animated = true, + tabBarGutter, } = this.props; let { inkBarAnimated, tabPaneAnimated } = typeof animated === 'object' ? { @@ -171,6 +173,7 @@ export default class Tabs extends React.Component { onPrevClick={onPrevClick} onNextClick={onNextClick} style={tabBarStyle} + tabBarGutter={tabBarGutter} /> ); diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index 534a220daf..43b0c5ad18 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -38,6 +38,7 @@ Ant Design 依次提供了三级选项卡,分别用于不同的场景。 | onNextClick | next 按钮被点击的回调 | Function | 无 | | onPrevClick | prev 按钮被点击的回调 | Function | 无 | | onTabClick | tab 被点击的回调 | Function | 无 | +| tabBarGutter | tabs 之间的间隙 | number | 无 | ### Tabs.TabPane diff --git a/package.json b/package.json index 5f5515e94f..3911cb055a 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "rc-steps": "~3.0.0", "rc-switch": "~1.6.0", "rc-table": "~6.1.0", - "rc-tabs": "~9.1.2", + "rc-tabs": "~9.2.0", "rc-time-picker": "~3.2.1", "rc-tooltip": "~3.7.0", "rc-tree": "~1.7.0",