import 'blue/lib/button/index.scss';
import Button from 'blue/lib/button';
import Icon from 'blue/lib/icon';
class Demo extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
loading: false,
iconLoading: false,
};
}
enterLoading() {
this.setState({ loading: true });
}
enterIconLoading() {
this.setState({ iconLoading: true });
}
render() {
return (<div>
<h3>不同尺寸的加载按钮</h3>
<Button type="primary" size="large" loading>
加载中
</Button>
<Button type="secondary" loading>
加载中
</Button>
<Button type="normal" size="small" loading>
加载中
</Button>
<h3>点击变加载</h3>
<Button type="primary" loading={this.state.loading} onClick={this.enterLoading.bind(this)}>
点击变加载
</Button>
<Button type="primary" loading={this.state.iconLoading} onClick={this.enterIconLoading.bind(this)}>
<Icon type="arrow-right" />点击变加载
</Button>
</div>);
}
}
ReactDOM.render(<Demo/>, mountNode);