From 1db4ae09acf51292f6b16cd951b485990805a334 Mon Sep 17 00:00:00 2001 From: Yuyao Nie Date: Wed, 23 Mar 2022 23:22:42 +0800 Subject: [PATCH] chore(components): [table] filter out invalid className (#6717) * chore(components): [table] filter out invalid className * chore(components): [table] modify codes by comments --- packages/components/table/src/table-body/styles-helper.ts | 2 +- packages/components/table/src/table-header/style.helper.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/components/table/src/table-body/styles-helper.ts b/packages/components/table/src/table-body/styles-helper.ts index 81a53f7464..263688074c 100644 --- a/packages/components/table/src/table-body/styles-helper.ts +++ b/packages/components/table/src/table-body/styles-helper.ts @@ -98,7 +98,7 @@ function useStyles(props: Partial>) { ) } classes.push(ns.e('cell')) - return classes.join(' ') + return classes.filter((className) => Boolean(className)).join(' ') } const getSpan = ( row: T, diff --git a/packages/components/table/src/table-header/style.helper.ts b/packages/components/table/src/table-header/style.helper.ts index e6479df422..357a9689dd 100644 --- a/packages/components/table/src/table-header/style.helper.ts +++ b/packages/components/table/src/table-header/style.helper.ts @@ -109,7 +109,7 @@ function useStyle(props: TableHeaderProps) { classes.push(ns.e('cell')) - return classes.join(' ') + return classes.filter((className) => Boolean(className)).join(' ') } return {