mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 12:58:38 +08:00
修复 Image 裁剪不出来的问题
This commit is contained in:
parent
a804e27d43
commit
65ea41b96f
@ -471,10 +471,15 @@ export default class ImageControl extends React.Component<ImageProps, ImageState
|
|||||||
const {multiple, crop} = this.props;
|
const {multiple, crop} = this.props;
|
||||||
|
|
||||||
if (crop && !multiple) {
|
if (crop && !multiple) {
|
||||||
|
const file = files[0] as FileValue;
|
||||||
|
if (!file.preview || !file.url) {
|
||||||
|
file.preview = window.URL.createObjectURL(file);
|
||||||
|
}
|
||||||
|
|
||||||
return this.setState({
|
return this.setState({
|
||||||
locked: true,
|
locked: true,
|
||||||
lockedReason: '请选择放弃或者应用',
|
lockedReason: '请选择放弃或者应用',
|
||||||
cropFile: files[0] as FileValue
|
cropFile: file
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user