mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
Merge pull request #466 from benjycui/feat-button
feat: make `Button` easy to use
This commit is contained in:
commit
d184d87308
@ -2,14 +2,15 @@
|
||||
|
||||
- order: 5
|
||||
|
||||
可以将多个 `Button` 放入 `ButtonGroup` 的容器中。
|
||||
可以将多个 `Button` 放入 `Button.Group` 的容器中。
|
||||
|
||||
通过设置 `size` 为 `large` `small` 分别把按钮组合设为大、小尺寸。若不设置 `size`,则尺寸为中。
|
||||
|
||||
---
|
||||
|
||||
````jsx
|
||||
import { Button, ButtonGroup, Icon } from 'antd';
|
||||
import { Button, Icon } from 'antd';
|
||||
const ButtonGroup = Button.Group;
|
||||
|
||||
ReactDOM.render(<div>
|
||||
<h4>基本组合</h4>
|
||||
|
@ -1,7 +1,5 @@
|
||||
import Button from './button';
|
||||
import ButtonGroup from './button-group';
|
||||
|
||||
export {
|
||||
Button,
|
||||
ButtonGroup,
|
||||
};
|
||||
Button.Group = ButtonGroup;
|
||||
export default Button;
|
||||
|
@ -7,8 +7,9 @@
|
||||
---
|
||||
|
||||
````jsx
|
||||
import { Progress, Button, ButtonGroup, Icon } from 'antd';
|
||||
import { Progress, Button, Icon } from 'antd';
|
||||
const ProgressCircle = Progress.Circle;
|
||||
const ButtonGroup = Button.Group;
|
||||
|
||||
const MyProgress = React.createClass({
|
||||
getInitialState() {
|
||||
|
@ -7,8 +7,9 @@
|
||||
---
|
||||
|
||||
````jsx
|
||||
import { Progress, Button, ButtonGroup, Icon } from 'antd';
|
||||
import { Progress, Button, Icon } from 'antd';
|
||||
const ProgressLine = Progress.Line;
|
||||
const ButtonGroup = Button.Group;
|
||||
|
||||
const MyProgress = React.createClass({
|
||||
getInitialState() {
|
||||
|
4
index.js
4
index.js
@ -50,8 +50,8 @@ const antd = {
|
||||
Badge: require('./components/badge'),
|
||||
Menu: require('./components/menu'),
|
||||
Timeline: require('./components/timeline'),
|
||||
Button: require('./components/button').Button,
|
||||
ButtonGroup: require('./components/button').ButtonGroup,
|
||||
Button: require('./components/button'),
|
||||
ButtonGroup: require('./components/button').Group,
|
||||
Icon: require('./components/iconfont'),
|
||||
Row: require('./components/layout').Row,
|
||||
Col: require('./components/layout').Col,
|
||||
|
Loading…
Reference in New Issue
Block a user