From d5299267efdd4f3cbb0e77c59edeb80a142c79a6 Mon Sep 17 00:00:00 2001 From: qkiroc <30946345+qkiroc@users.noreply.github.com> Date: Wed, 17 Apr 2024 00:25:39 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20card=20subTitle=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E6=B8=B2=E6=9F=93=E6=96=B9=E5=BC=8F=20(#1003?= =?UTF-8?q?7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: card subTitle支持更多渲染方式 * feat: card subTitle支持更多渲染方式 * feat: card subTitle支持更多渲染方式 --------- Co-authored-by: qinhaoyan <30946345+qinhaoyan@users.noreply.github.com> --- packages/amis/src/renderers/Card.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/amis/src/renderers/Card.tsx b/packages/amis/src/renderers/Card.tsx index cad481107..27eaf551d 100644 --- a/packages/amis/src/renderers/Card.tsx +++ b/packages/amis/src/renderers/Card.tsx @@ -86,7 +86,7 @@ export interface CardSchema extends BaseSchema { /** * 副标题 */ - subTitle?: SchemaTpl; + subTitle?: SchemaTpl | Schema; subTitleClassName?: SchemaClassName; subTitlePlaceholder?: string; @@ -593,8 +593,8 @@ export class CardRenderer extends React.Component { if (header) { const {subTitle: subTitleTpl} = header || {}; - const subTitle = filter(subTitleTpl, data); - return subTitle ? render('sub-title', subTitleTpl!) : undefined; + // const subTitle = filter(subTitleTpl, data); + return subTitleTpl ? render('sub-title', subTitleTpl, data) : undefined; } return; }