|
@@ -18,13 +18,13 @@ function beforeUpload(file) {
|
18
|
18
|
|
19
|
19
|
|
20
|
20
|
export default (props) => {
|
21
|
|
- const { onChange, id ,refrash } = props;
|
|
21
|
+ const { onChange, id, refrash } = props;
|
22
|
22
|
|
23
|
23
|
const [loading, setLoading] = useState(false);
|
24
|
24
|
|
25
|
25
|
const handleChange = info => {
|
26
|
26
|
if (info.file.status === 'uploading') {
|
27
|
|
- setLoading(true);
|
|
27
|
+ setLoading(true);
|
28
|
28
|
return;
|
29
|
29
|
}
|
30
|
30
|
if (info.file.status === 'error') {
|
|
@@ -58,7 +58,8 @@ export default (props) => {
|
58
|
58
|
beforeUpload={beforeUpload}
|
59
|
59
|
onChange={handleChange}
|
60
|
60
|
>
|
61
|
|
- <Button type="primary" disabled={loading} icon={loading ? <LoadingOutlined /> : <UploadOutlined />}>上传</Button>
|
|
61
|
+ <Button type="primary" disabled={loading} icon={loading ?
|
|
62
|
+ <LoadingOutlined /> : <UploadOutlined />}>上传</Button>
|
62
|
63
|
</Upload>
|
63
|
64
|
);
|
64
|
65
|
}
|