Skip to content

Commit

Permalink
ver. 0.4.20
Browse files Browse the repository at this point in the history
  • Loading branch information
samoay committed Dec 29, 2018
1 parent 64ef09e commit e4c6b38
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# History
----

## 0.4.20

* `CHANGED` do not excute onClick while loading
* `NEW` add count down feature

## 0.4.19

* `CHANGED` support providing style by js
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ http://uxcore.github.io/uxcore/css/button/
|className|增加额外的class|string|''|
|htmlType|html dom 的 type 属性(`submit` `button` `reset`)|string|button|
|style|style 属性|object||
|loading|loading状态|bool|false|
|loading|loading状态, loading 为 true 时不会触发 onClick 动作 |bool|false|
|countDown|按钮倒计时功能,单位为秒(s),倒计时结束之后会触发`onCountDownEnd`回调函数|number|undefined|
|onCountDownEnd|倒计时结束之后的回调函数|function|noop|

32 changes: 24 additions & 8 deletions demo/ButtonDemo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import '../style';
/* eslint-disable react/prefer-stateless-function */

class Demo extends React.Component {
constructor(props) {
super(props);

this.state = {
agreeDisabled: true,
};
}
render() {
return (
<div>
Expand Down Expand Up @@ -151,36 +158,45 @@ class Demo extends React.Component {
{'图标按钮'}
</h2>
<Button size="small">
<Icon name="xiazai" />
<Icon usei name="xiazai" />
small
</Button>
<Button size="middle">
<Icon name="xiazai" />
<Icon usei name="xiazai" />
middle
</Button>
<Button size="large">
<Icon name="xiazai" />
<Icon usei name="xiazai" />
large
</Button>
<Button type="primary">
<Icon name="xiazai" />
<Icon usei name="xiazai" />
primary
</Button>
<Button type="secondary">
<Icon name="xiazai" />
<Icon usei name="xiazai" />
secondary
</Button>
<Button type="outline">
<Icon name="xiazai" />
<Icon usei name="xiazai" />
outline
</Button>
</div>
<div>
<h2>
{'倒计时'}
</h2>
<Button size="small" countDown={3} onCountDownEnd={() => { console.log(111); }}>
small
<Button
size="middle"
disabled={this.state.agreeDisabled}
countDown={10}
onCountDownEnd={() => {
this.setState({
agreeDisabled: false,
});
}}
>
同意
</Button>
</div>
</div>
Expand Down

0 comments on commit e4c6b38

Please sign in to comment.