From 5549afac3ffe420c4bff0e95bc3c06ef02c39b4c Mon Sep 17 00:00:00 2001 From: 3lang <675483520@qq.com> Date: Fri, 12 Nov 2021 08:43:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DCell.Group=E7=9A=84sty?= =?UTF-8?q?le=E5=92=8CclassName=E4=BD=9C=E7=94=A8=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E4=B8=8D=E5=8C=85=E6=8B=ACtitle=E7=9A=84=E9=97=AE=E9=A2=98=20#?= =?UTF-8?q?153?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react-vant/src/cell/CellGroup.tsx | 29 ++++++++-------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/packages/react-vant/src/cell/CellGroup.tsx b/packages/react-vant/src/cell/CellGroup.tsx index f8d5c89b7..0e362826c 100644 --- a/packages/react-vant/src/cell/CellGroup.tsx +++ b/packages/react-vant/src/cell/CellGroup.tsx @@ -11,29 +11,22 @@ const CellGroup: React.FC = (props) => { const [bem] = createNamespace('cell-group', prefixCls); const renderGroup = () => ( -
+
{props.children}
); - const renderTitle = () =>
{title}
; + const renderTitle = () => { + if (title) return
{title}
; + return null; + }; - if (title) - return ( - <> - {renderTitle()} - {renderGroup()} - - ); - - return renderGroup(); + return ( +
+ {renderTitle()} + {renderGroup()} +
+ ); }; CellGroup.defaultProps = {