fix(client): fix action component warning (#2818)

This commit is contained in:
Junyi 2023-10-13 15:49:18 +08:00 committed by GitHub
parent 2a8cc10faa
commit 62d9200657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {