From 8bd8ba7e2fb1701445519d6948dd8e88cb54b92c Mon Sep 17 00:00:00 2001 From: dengfuping Date: Wed, 20 Mar 2024 10:40:32 +0800 Subject: [PATCH] improve(design): hide Table empty when loading --- packages/design/src/spin/style/index.ts | 3 ++- packages/design/src/table/style/index.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/design/src/spin/style/index.ts b/packages/design/src/spin/style/index.ts index c0859cf6a..8c237bda3 100644 --- a/packages/design/src/spin/style/index.ts +++ b/packages/design/src/spin/style/index.ts @@ -39,7 +39,8 @@ const genNestedSizeStyle = (spinDotSize: number, token: SpinToken): CSSObject => const textPaddingTop = (spinDotHight - fontSize) / 2 + 2; return { // only work for oceanbase indicator - [`&${componentCls}-oceanbase`]: { + // `& > ${componentCls}-oceanbase` is compatible with double .ant-spin like Table loading + [`&${componentCls}-oceanbase, & > ${componentCls}-oceanbase`]: { [`${componentCls}-dot`]: { marginLeft: dotMarginLeft, marginTop: dotMarginTop, diff --git a/packages/design/src/table/style/index.ts b/packages/design/src/table/style/index.ts index 154de4c8e..6ee6ee8a7 100644 --- a/packages/design/src/table/style/index.ts +++ b/packages/design/src/table/style/index.ts @@ -162,6 +162,16 @@ export const genTableStyle: GenerateStyle = (token: TableToken): CSS }, }, + // loading style + [`${componentCls}-wrapper ${antCls}-spin-blur`]: { + [`${componentCls}-tbody`]: { + [`${componentCls}-placeholder`]: { + // hide empty when Table loading + visibility: 'hidden', + }, + }, + }, + // 分页器样式 [`${componentCls}-wrapper`]: { [`${componentCls}-pagination`]: {