Merge pull request #301 from 2betop/master

修复 Image 裁剪不出来的问题
This commit is contained in:
liaoxuezhi 2019-10-24 00:08:05 +08:00 committed by GitHub
commit 9a8d982ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -471,10 +471,15 @@ export default class ImageControl extends React.Component<ImageProps, ImageState
const {multiple, crop} = this.props;
if (crop && !multiple) {
const file = files[0] as FileValue;
if (!file.preview || !file.url) {
file.preview = window.URL.createObjectURL(file);
}
return this.setState({
locked: true,
lockedReason: '请选择放弃或者应用',
cropFile: files[0] as FileValue
cropFile: file
});
}