Merge pull request #4714 from igrowp/fix-upload

fix: 上传文件不能回显问题
This commit is contained in:
hsm-lv 2022-06-27 21:21:06 +08:00 committed by GitHub
commit 832a6ec500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,11 +440,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
componentDidUpdate(prevProps: FileProps) { componentDidUpdate(prevProps: FileProps) {
const props = this.props; const props = this.props;
if ( if (prevProps.value !== props.value && this.emitValue !== props.value) {
prevProps.value !== props.value &&
this.emitValue !== props.value &&
props.formInited !== false
) {
const value: string | Array<string | FileValue> | FileValue = props.value; const value: string | Array<string | FileValue> | FileValue = props.value;
const joinValues = props.joinValues; const joinValues = props.joinValues;
const delimiter = props.delimiter as string; const delimiter = props.delimiter as string;
@ -489,7 +485,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
{ {
files: files files: files
}, },
this.syncAutoFill props.formInited !== false ? this.syncAutoFill : undefined
); );
} }
} }