按钮点击事件和禁用效果。

This commit is contained in:
tengge1 2019-05-20 20:38:23 +08:00
parent 5f04c9f7ed
commit 123cfec441
2 changed files with 3 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class EWorkspace extends React.Component {
<FormControl>
<Label>Button</Label>
<Button onClick={() => { alert('Default!'); }}>Default</Button>
<Button color={'primary1'}>Primary</Button>
<Button color={'primary'}>Primary</Button>
<Button color={'success'}>Success</Button>
<Button color={'warn'}>Warn</Button>
<Button color={'danger'}>Danger</Button>

View File

@ -18,7 +18,7 @@ class Button extends React.Component {
Button.propTypes = {
className: PropTypes.string,
style: PropTypes.object,
children: PropTypes.element,
children: PropTypes.node,
color: PropTypes.oneOf(['primary', 'success', 'warn', 'danger']),
disabled: PropTypes.bool,
};
@ -27,6 +27,7 @@ Button.defaultProps = {
className: null,
style: null,
children: null,
color: null,
disabled: false,
};