mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
1.0 KiB
1.0 KiB
加载中
- order: 7
加载按钮。最后一个按钮演示点击后进入加载状态。
var App = React.createClass({
getInitialState() {
return {
loading: false
};
},
enterLoading() {
this.setState({
loading: true
});
},
render() {
var loadingClass = this.state.loading ? 'ant-btn-loading' : '';
return <div>
<button className="ant-btn ant-btn-primary ant-btn-lg ant-btn-loading">
加载中
</button>
<button className="ant-btn ant-btn-primary ant-btn-loading">
加载中
</button>
<button className="ant-btn ant-btn-primary ant-btn-sm ant-btn-loading">
加载中
</button>
<br />
<button className={'ant-btn ant-btn-primary ' + loadingClass} onClick={this.enterLoading}>
点击变加载
</button>
</div>;
}
});
React.render(<App />, document.getElementById('components-button-demo-loading'));