From 62d92006577586010faee722f2994840645d45ef Mon Sep 17 00:00:00 2001 From: Junyi Date: Fri, 13 Oct 2023 15:49:18 +0800 Subject: [PATCH] fix(client): fix action component warning (#2818) --- .../client/src/schema-component/antd/action/Action.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/action/Action.tsx b/packages/core/client/src/schema-component/antd/action/Action.tsx index 841a9f52b..bc03713be 100644 --- a/packages/core/client/src/schema-component/antd/action/Action.tsx +++ b/packages/core/client/src/schema-component/antd/action/Action.tsx @@ -38,6 +38,8 @@ export const Action: ComposedAction = observer( icon, title, onClick, + style, + openSize, ...others } = useProps(props); const { wrapSSR, componentCls, hashId } = useStyles(); @@ -54,7 +56,6 @@ export const Action: ComposedAction = observer( const designerProps = fieldSchema['x-designer-props']; const openMode = fieldSchema?.['x-component-props']?.['openMode']; const disabled = form.disabled || field.disabled || field.data?.disabled || props.disabled; - const openSize = fieldSchema?.['x-component-props']?.['openSize']; const linkageRules = fieldSchema?.['x-linkage-rules'] || []; const { designable } = useDesignable(); const tarComponent = useComponent(component) || component; @@ -111,10 +112,10 @@ export const Action: ComposedAction = observer( const buttonStyle = useMemo(() => { return { - ...others.style, + ...style, opacity: designable && field?.data?.hidden && 0.1, }; - }, [designable, field?.data?.hidden, others.style]); + }, [designable, field?.data?.hidden, style]); const renderButton = () => { if (!designable && field?.data?.hidden) {