mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:29:24 +08:00
fix: 修复inputImage的receiver等参数如果使用变量无法及时获取变量最新值的问题。
This commit is contained in:
parent
e9208b503f
commit
93cb1e3ca2
@ -14,7 +14,11 @@ import {FileRejection, ErrorCode, DropEvent} from 'react-dropzone';
|
||||
import 'blueimp-canvastoblob';
|
||||
import find from 'lodash/find';
|
||||
import {Payload, ActionObject} from 'amis-core';
|
||||
import {buildApi} from 'amis-core';
|
||||
import {buildApi,
|
||||
isEffectiveApi,
|
||||
normalizeApi,
|
||||
isApiOutdated,
|
||||
isApiOutdatedWithData} from 'amis-core';
|
||||
import {createObject, qsstringify, guid, isEmpty, qsparse} from 'amis-core';
|
||||
import {Icon, TooltipWrapper, Button} from 'amis-ui';
|
||||
import accepts from 'attr-accept';
|
||||
@ -1913,6 +1917,20 @@ export default class ImageControl extends React.Component<
|
||||
|
||||
@FormItem({
|
||||
type: 'input-image',
|
||||
sizeMutable: false
|
||||
sizeMutable: false,
|
||||
shouldComponentUpdate: (props: any, prevProps: any) =>
|
||||
!!isEffectiveApi(props.receiver, props.data) &&
|
||||
(isApiOutdated(
|
||||
props.receiver,
|
||||
prevProps.receiver,
|
||||
props.data,
|
||||
prevProps.data
|
||||
) ||
|
||||
isApiOutdatedWithData(
|
||||
props.receiver,
|
||||
prevProps.receiver,
|
||||
props.data,
|
||||
prevProps.data
|
||||
))
|
||||
})
|
||||
export class ImageControlRenderer extends ImageControl {}
|
||||
|
Loading…
Reference in New Issue
Block a user