mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-26 20:20:00 +08:00
Merge pull request #445 from kevyu/master
remove state items in uploadList.jsx
This commit is contained in:
commit
bf28819158
@ -4,30 +4,19 @@ import Icon from '../iconfont';
|
|||||||
|
|
||||||
const prefixCls = 'ant-upload';
|
const prefixCls = 'ant-upload';
|
||||||
|
|
||||||
|
|
||||||
export default React.createClass({
|
export default React.createClass({
|
||||||
getDefaultProps() {
|
getDefaultProps() {
|
||||||
return {
|
return {
|
||||||
items: []
|
items: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getInitialState() {
|
|
||||||
return {
|
|
||||||
items: this.props.items
|
|
||||||
};
|
|
||||||
},
|
|
||||||
componentWillReceiveProps(nextProps) {
|
|
||||||
if ('items' in nextProps) {
|
|
||||||
this.setState({
|
|
||||||
items: nextProps.items
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleClose(file) {
|
handleClose(file) {
|
||||||
this.props.onRemove(file);
|
this.props.onRemove(file);
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let list = this.state.items.map((file) => {
|
let list = this.props.items.map((file) => {
|
||||||
let statusIcon = file.status === 'done' ?
|
let statusIcon = file.status === 'done' ?
|
||||||
<Icon type="check" className={prefixCls + '-success-icon'} /> :
|
<Icon type="check" className={prefixCls + '-success-icon'} /> :
|
||||||
<Icon type="loading" />;
|
<Icon type="loading" />;
|
||||||
|
Loading…
Reference in New Issue
Block a user