From 9b6e75b6ffe7484e161265a15890a9c710be3158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E4=BD=B3=E8=B1=AA?= <1440054388@qq.com> Date: Fri, 4 Nov 2022 14:33:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:Remark=E7=BB=84=E4=BB=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BE=E6=A0=87=20(#5694)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat:Remark组件支持自定义图标 * 去掉多余内容 Co-authored-by: xujiahao01 --- packages/amis/src/renderers/Remark.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/amis/src/renderers/Remark.tsx b/packages/amis/src/renderers/Remark.tsx index 55eadc732..2eb128bc8 100644 --- a/packages/amis/src/renderers/Remark.tsx +++ b/packages/amis/src/renderers/Remark.tsx @@ -3,7 +3,7 @@ import {Renderer, RendererProps} from 'amis-core'; import {Api, SchemaNode, Schema, ActionObject} from 'amis-core'; import cx from 'classnames'; import {TooltipWrapper} from 'amis-ui'; -import {filter} from 'amis-core'; +import {filter, generateIcon} from 'amis-core'; import {ClassNamesFn, themeable} from 'amis-core'; import {hasIcon, Icon} from 'amis-ui'; import {BaseSchema, SchemaClassName, SchemaIcon, SchemaTpl} from '../Schema'; @@ -131,7 +131,9 @@ class Remark extends React.Component { <> {finalLabel ? {finalLabel} : null} {finalIcon ? ( - hasIcon(finalIcon) ? ( + typeof finalIcon === 'object' ? ( + generateIcon(cx, finalIcon) + ) : hasIcon(finalIcon) ? (