标签:sign react http des 加载 rgba style click sig
const { Button } = antd; const { PoweroffOutlined } = icons; class App extends React.Component { state = { loadings: [], }; enterLoading = index => { this.setState(({ loadings }) => { const newLoadings = [...loadings]; newLoadings[index] = true; return { loadings: newLoadings, }; }); setTimeout(() => { this.setState(({ loadings }) => { const newLoadings = [...loadings]; newLoadings[index] = false; return { loadings: newLoadings, }; }); }, 6000); }; render() { const { loadings } = this.state; return ( <> <Button type="primary" loading={loadings[0]} onClick={() => this.enterLoading(0)}> Click me! </Button> <Button type="primary" icon={<PoweroffOutlined />} loading={loadings[1]} onClick={() => this.enterLoading(1)} > Click me! </Button> <Button type="primary" icon={<PoweroffOutlined />} loading={loadings[2]} onClick={() => this.enterLoading(2)} /> </> ); } } ReactDOM.render(<App />, mountNode);
https://ant.design/components/button-cn/
标签:sign react http des 加载 rgba style click sig
原文地址:https://www.cnblogs.com/lbx6935/p/14115095.html