fix: amis:table-view 预览和实际外观不一致 (#10091)

Co-authored-by: liaoxuezhi <2698393+2betop@users.noreply.github.com>
This commit is contained in:
lq 2024-05-11 15:50:51 +08:00 committed by GitHub
parent f628761aad
commit 4ac106eff2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -276,10 +276,12 @@ export default class TableView extends React.Component<TableViewProps, object> {
wrapperCustomStyle,
env,
themeCss,
baseControlClassName
testid,
baseControlClassName,
style
} = this.props;
return (
const renderNode = (
<table
className={cx(
'TableView',
@ -319,6 +321,16 @@ export default class TableView extends React.Component<TableViewProps, object> {
/>
</table>
);
if (style && Object.keys(style).length) {
return (
<div className="ae-TableViewEditor" style={style}>
{renderNode}
</div>
);
}
return renderNode;
}
}