mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-23 04:01:48 +08:00
629 B
629 B
预加载的卡片
- order: 4
数据读入前会有文本块样式。
import { Card } from 'antd';
const App = React.createClass({
getInitialState() {
return {
loading: true,
content: '',
};
},
componentDidMount() {
// mock loading
setTimeout(() => {
this.setState({
loading: false,
content: '卡片的内容',
});
}, 2000);
},
render() {
return (
<Card loading={this.state.loading} title="卡片标题" style={{ width: 300 }}>
{this.state.content}
</Card>
);
},
});
ReactDOM.render(<App />, mountNode);