mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 04:30:06 +08:00
Merge branch 'master' of github.com:ant-design/ant-design
This commit is contained in:
commit
fc6ce27fd5
44
components/button/demo/multiple.md
Normal file
44
components/button/demo/multiple.md
Normal file
@ -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 = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">1st item</Menu.Item>
|
||||
<Menu.Item key="2">2nd item</Menu.Item>
|
||||
<Menu.Item key="3">3rd item</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Button type="primary">primary</Button>
|
||||
<Button type="ghost">secondary</Button>
|
||||
<Dropdown overlay={menu}>
|
||||
<Button type="ghost">
|
||||
more <Icon type="down" />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
</div>,
|
||||
mountNode
|
||||
);
|
||||
````
|
@ -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';
|
||||
|
@ -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(<div>
|
||||
<Tag closable color="blue">Blue</Tag>
|
||||
<Tag closable color="green">Green</Tag>
|
||||
<Tag closable color="yellow"><a href="https://github.com/ant-design/ant-design/issues/1862">Yellow</a></Tag>
|
||||
<Tag closable color="red">Red</Tag>
|
||||
</div>, mountNode);
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Tag closable color="blue">Blue</Tag>
|
||||
<Tag closable color="green">Green</Tag>
|
||||
<Tag closable color="yellow"><a href="https://github.com/ant-design/ant-design/issues/1862">Yellow</a></Tag>
|
||||
<Tag closable color="red">Red</Tag>
|
||||
</div>,
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 2
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: 动态添加和删除
|
||||
en-US: Dynamically add and remove
|
||||
|
@ -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 | - |
|
||||
|
@ -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<TagProps, any> {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
warning(!('color' in props), '`Tag[color]` is deprecated, please override color by CSS instead.');
|
||||
|
||||
this.state = {
|
||||
closing: false,
|
||||
|
@ -19,4 +19,3 @@ title: Tag
|
||||
| closable | 标签是否可以关闭 | boolean | false |
|
||||
| onClose | 关闭时的回调 | function(event) | - |
|
||||
| afterClose | 关闭动画完成后的回调 | function(event) | - |
|
||||
| color | 标签的色彩:`blue` `green` `yellow` `red` | string | - |
|
||||
|
Loading…
Reference in New Issue
Block a user