Merge pull request #5977 from hsm-lv/fix-inputImage-event

feat:图片上传成功事件参数优化
This commit is contained in:
hsm-lv 2022-12-26 11:07:05 +08:00 committed by GitHub
commit c3d32ad10d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,3 @@
import React = require('react');
import PageRenderer from '../../src/renderers/Page';
import * as renderer from 'react-test-renderer';
import {render, fireEvent, cleanup, waitFor} from '@testing-library/react';
import '../../src';

View File

@ -850,7 +850,10 @@ export default class FileControl extends React.Component<FileProps, FileState> {
const dispatcher = await this.dispatchEvent('success', {
...file, // 保留历史结构
item: file,
item: {
...file,
...ret.data
},
value
});
if (dispatcher?.prevented) {

View File

@ -1120,7 +1120,10 @@ export default class ImageControl extends React.Component<
const dispatcher = await this.dispatchEvent('success', {
...file, // 保留历史结构
item: file,
item: {
...file,
...ret.data
},
value: obj.value
});
if (dispatcher?.prevented) {