|
|
@ -4,30 +4,19 @@ import Icon from '../iconfont'; |
|
|
|
|
|
|
|
const prefixCls = 'ant-upload'; |
|
|
|
|
|
|
|
|
|
|
|
export default React.createClass({ |
|
|
|
getDefaultProps() { |
|
|
|
return { |
|
|
|
items: [] |
|
|
|
}; |
|
|
|
}, |
|
|
|
getInitialState() { |
|
|
|
return { |
|
|
|
items: this.props.items |
|
|
|
}; |
|
|
|
}, |
|
|
|
componentWillReceiveProps(nextProps) { |
|
|
|
if ('items' in nextProps) { |
|
|
|
this.setState({ |
|
|
|
items: nextProps.items |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleClose(file) { |
|
|
|
this.props.onRemove(file); |
|
|
|
}, |
|
|
|
|
|
|
|
render() { |
|
|
|
let list = this.state.items.map((file) => { |
|
|
|
let list = this.props.items.map((file) => { |
|
|
|
let statusIcon = file.status === 'done' ? |
|
|
|
<Icon type="check" className={prefixCls + '-success-icon'} /> : |
|
|
|
<Icon type="loading" />; |
|
|
|