From 353f2cb004f47d9b145906a64125717d4a5ad1a8 Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 7 Apr 2016 11:18:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?this=E6=9C=AA=E7=BB=91=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/upload/index.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/upload/index.jsx b/components/upload/index.jsx index 3ec2a8403a..316df0aab8 100644 --- a/components/upload/index.jsx +++ b/components/upload/index.jsx @@ -173,12 +173,13 @@ export default class Upload extends React.Component { this.handleRemove(targetItem); } - beforeUpload(file) { + beforeUpload = (file) => { + console.log(this.props); this.recentUploadStatus = this.props.beforeUpload(file); return this.recentUploadStatus; } - handleRemove(file) { + handleRemove = (file) => { let fileList = this.removeFile(file); if (fileList) { this.onChange({ From 6614fb9746db17ebdaa938f89ab3252bb05ccc22 Mon Sep 17 00:00:00 2001 From: tom Date: Thu, 7 Apr 2016 11:39:23 +0800 Subject: [PATCH 2/2] fix bug --- components/upload/index.jsx | 3 +-- components/upload/uploadList.jsx | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/upload/index.jsx b/components/upload/index.jsx index 316df0aab8..c1b5666077 100644 --- a/components/upload/index.jsx +++ b/components/upload/index.jsx @@ -174,12 +174,11 @@ export default class Upload extends React.Component { } beforeUpload = (file) => { - console.log(this.props); this.recentUploadStatus = this.props.beforeUpload(file); return this.recentUploadStatus; } - handleRemove = (file) => { + handleRemove(file) { let fileList = this.removeFile(file); if (fileList) { this.onChange({ diff --git a/components/upload/uploadList.jsx b/components/upload/uploadList.jsx index 8c962f13bb..641b0bcb8e 100644 --- a/components/upload/uploadList.jsx +++ b/components/upload/uploadList.jsx @@ -2,7 +2,7 @@ import React from 'react'; import Animate from 'rc-animate'; import Icon from '../icon'; const prefixCls = 'ant-upload'; -import { Line } from '../progress'; +import Progress from '../progress'; import classNames from 'classnames'; // https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL @@ -81,7 +81,7 @@ export default class UploadList extends React.Component { if (file.status === 'uploading') { progress = (
- +
); }