From 80e93078be2071e2f7adcb2afaa647e0331b88b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=A4=9A=E7=9B=8A?= Date: Mon, 4 Dec 2023 20:49:58 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20classNameExpr=20=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=89=80=E6=9C=89=E5=B1=9E=E6=80=A7=E9=83=BD=E6=94=AF=E6=8C=81?= =?UTF-8?q?,=E4=B8=8D=E9=9C=80=E8=A6=81=E5=8D=95=E7=8B=AC=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=BA=86=20Closes=20#3869=20(#9007)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Table/TableCell.tsx | 5 +---- packages/amis/src/renderers/Table2/index.tsx | 10 ---------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/amis/src/renderers/Table/TableCell.tsx b/packages/amis/src/renderers/Table/TableCell.tsx index 5c13ec268..0017537de 100644 --- a/packages/amis/src/renderers/Table/TableCell.tsx +++ b/packages/amis/src/renderers/Table/TableCell.tsx @@ -154,10 +154,7 @@ export class TableCell extends React.Component { 1 ? rowSpan : undefined} style={style} - className={cx( - className, - column.classNameExpr ? filter(column.classNameExpr, data) : null - )} + className={cx(className)} tabIndex={tabIndex} onKeyUp={onKeyUp} > diff --git a/packages/amis/src/renderers/Table2/index.tsx b/packages/amis/src/renderers/Table2/index.tsx index 7e1bdbc1c..91019b74a 100644 --- a/packages/amis/src/renderers/Table2/index.tsx +++ b/packages/amis/src/renderers/Table2/index.tsx @@ -993,16 +993,6 @@ export default class Table2 extends React.Component { }); } - // 设置了单元格样式 - if (column.classNameExpr) { - clone.className = (record: any, rowIndex: number) => { - const className = filter(column.classNameExpr, {record, rowIndex}); - return `${className}${ - column.className ? ` ${column.className}` : '' - }`; - }; - } - // 设置了列搜索 if (column.searchable) { clone.filterDropdown = (