diff --git a/components/button/demo/multiple.md b/components/button/demo/multiple.md new file mode 100644 index 0000000000..c2d378a7d2 --- /dev/null +++ b/components/button/demo/multiple.md @@ -0,0 +1,44 @@ +--- +order: 6 +title: + zh-CN: 多个按钮组合 + en-US: Multiple Buttons +--- + +## zh-CN + +按钮组合使用时,推荐使用1个主操作 + n 个次操作,3个以上操作时把更多操作放到 `Dropdown.Button` 中组合使用。 + +## en-US + +If you need several buttons, we recommend that you use 1 primary button + n secondary buttons, and if there are more than three operations, you can group some of them into `Dropdown.Button`. + + +````jsx +import { Button, Menu, Dropdown, Icon } from 'antd'; + +function handleMenuClick(e) { + console.log('click', e); +} + +const menu = ( + + 1st item + 2nd item + 3rd item + +); + +ReactDOM.render( +
+ + + + + +
, + mountNode +); +```` diff --git a/components/table/demo/row-selection.md b/components/table/demo/row-selection.md index 9ce02fc6ae..1f21597f6d 100644 --- a/components/table/demo/row-selection.md +++ b/components/table/demo/row-selection.md @@ -11,7 +11,7 @@ title: ## en-US -Rows can be selectable by making fisrt column as a selectable column. +Rows can be selectable by making first column as a selectable column. ````jsx import { Table } from 'antd'; diff --git a/components/tag/demo/colorful.md b/components/tag/demo/colorful.md index 9fa67d2f53..3453a7ab67 100644 --- a/components/tag/demo/colorful.md +++ b/components/tag/demo/colorful.md @@ -1,24 +1,21 @@ --- -order: 1 -title: - zh-CN: 各种类型 - en-US: Colorful tags +debug: true +order: -1 +title: Colorful Tags for Debugging --- -## zh-CN - -四种颜色的标签。 - -## en-US -Colorful tags. +`Tag[color]` is deprecated, but we need this demo for debugging until next major version. ````jsx import { Tag } from 'antd'; -ReactDOM.render(
- Blue - Green - Yellow - Red -
, mountNode); +ReactDOM.render( +
+ Blue + Green + Yellow + Red +
, + mountNode +); ```` diff --git a/components/tag/demo/control.md b/components/tag/demo/control.md index f18d88b4f9..6eec297369 100644 --- a/components/tag/demo/control.md +++ b/components/tag/demo/control.md @@ -1,5 +1,5 @@ --- -order: 2 +order: 1 title: zh-CN: 动态添加和删除 en-US: Dynamically add and remove diff --git a/components/tag/index.en-US.md b/components/tag/index.en-US.md index 99404515cf..31d507f353 100644 --- a/components/tag/index.en-US.md +++ b/components/tag/index.en-US.md @@ -19,4 +19,3 @@ Tag for categorizing or markuping. | closable | Tag can be closed. | boolean | false | | onClose | Callback when tag was closed | function(event)| - | | afterClose | Callback when closed animation is complete | function(event)| - | -| color | Tag's color: `blue` `green` `yellow` `red` | string | - | diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 8606625542..27bb9167d9 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -1,10 +1,11 @@ import React from 'react'; import ReactDOM from 'react-dom'; import Animate from 'rc-animate'; -import Icon from '../icon'; import classNames from 'classnames'; -import splitObject from '../_util/splitObject'; import omit from 'omit.js'; +import warning from 'warning'; +import Icon from '../icon'; +import splitObject from '../_util/splitObject'; export interface TagProps { /** 标签是否可以关闭 */ @@ -13,8 +14,6 @@ export interface TagProps { onClose?: Function; /** 动画关闭后的回调 */ afterClose?: Function; - /** 标签的色彩 */ - color?: string; style?: React.CSSProperties; } @@ -26,6 +25,7 @@ export default class Tag extends React.Component { constructor(props) { super(props); + warning(!('color' in props), '`Tag[color]` is deprecated, please override color by CSS instead.'); this.state = { closing: false, diff --git a/components/tag/index.zh-CN.md b/components/tag/index.zh-CN.md index c48e9acbb1..0964839737 100644 --- a/components/tag/index.zh-CN.md +++ b/components/tag/index.zh-CN.md @@ -19,4 +19,3 @@ title: Tag | closable | 标签是否可以关闭 | boolean | false | | onClose | 关闭时的回调 | function(event) | - | | afterClose | 关闭动画完成后的回调 | function(event) | - | -| color | 标签的色彩:`blue` `green` `yellow` `red` | string | - |