diff --git a/packages/amis/src/renderers/Card.tsx b/packages/amis/src/renderers/Card.tsx index 7d2958fac..ef4bd64c4 100644 --- a/packages/amis/src/renderers/Card.tsx +++ b/packages/amis/src/renderers/Card.tsx @@ -795,6 +795,7 @@ export class CardItemFieldRenderer extends TableCell { render, style, wrapperComponent: Component, + contentsOnly, labelClassName, value, data, @@ -832,9 +833,10 @@ export class CardItemFieldRenderer extends TableCell { ); } - if (!Component) { + if (contentsOnly) { return body as JSX.Element; } + Component = Component || 'div'; return ( - + { @@ -178,6 +179,7 @@ export class StaticFieldRenderer extends TableCell { render, style, wrapperComponent: Component, + contentsOnly, labelClassName, value, data, @@ -210,16 +212,14 @@ export class StaticFieldRenderer extends TableCell { style.width = style.width || width; } - if (!Component) { + if (contentsOnly) { return body as JSX.Element; } + Component = Component || 'div'; + return ( - + {body} ); diff --git a/packages/amis/src/renderers/List.tsx b/packages/amis/src/renderers/List.tsx index c6e92e067..f4eb86568 100644 --- a/packages/amis/src/renderers/List.tsx +++ b/packages/amis/src/renderers/List.tsx @@ -1421,6 +1421,7 @@ export class ListItemFieldRenderer extends TableCell { render, style, wrapperComponent: Component, + contentsOnly, labelClassName, value, data, @@ -1456,9 +1457,10 @@ export class ListItemFieldRenderer extends TableCell { ); } - if (!Component) { + if (contentsOnly) { return body as JSX.Element; } + Component = Component || 'div'; return ( {(popOver as SchemaPopOverObject)?.showIcon !== false ? ( <> - + - + {this.state.isOpened ? this.renderPopOver() : null} diff --git a/packages/amis/src/renderers/QuickEdit.tsx b/packages/amis/src/renderers/QuickEdit.tsx index ebe17f085..df326a4c4 100644 --- a/packages/amis/src/renderers/QuickEdit.tsx +++ b/packages/amis/src/renderers/QuickEdit.tsx @@ -564,7 +564,7 @@ export const HocQuickEdit = } onKeyUp={this.handleKeyUp} > - + { +export class TableCell extends React.Component { static defaultProps = { wrapperComponent: 'td' }; @@ -27,7 +28,8 @@ export class TableCell extends React.Component { 'body', 'tpl', 'rowSpan', - 'remark' + 'remark', + 'contentsOnly' ]; readonly propsNeedRemove: string[] = []; @@ -40,6 +42,7 @@ export class TableCell extends React.Component { render, style = {}, wrapperComponent: Component, + contentsOnly, column, value, data, @@ -146,12 +149,14 @@ export class TableCell extends React.Component { style.background = color; } - if (!Component) { + if (contentsOnly) { return body as JSX.Element; } if (isHead) { Component = 'th'; + } else { + Component = Component || 'td'; } return (