From 18700a903837cb0bbbc412ab2deebfbf3b97b9a2 Mon Sep 17 00:00:00 2001 From: Janry Date: Thu, 26 May 2022 12:45:15 +0800 Subject: [PATCH] fix(next): fix space item empty style (#3149) --- packages/next/docs/components/Space.md | 10 ++++++++++ packages/next/src/space/main.scss | 8 ++++++++ packages/next/src/space/style.ts | 1 + packages/next/src/style.ts | 1 + 4 files changed, 20 insertions(+) create mode 100644 packages/next/src/space/main.scss diff --git a/packages/next/docs/components/Space.md b/packages/next/docs/components/Space.md index 8be8341c57b..7da9929bc77 100644 --- a/packages/next/docs/components/Space.md +++ b/packages/next/docs/components/Space.md @@ -50,6 +50,16 @@ export default () => ( name="lastName" x-decorator="FormItem" x-component="Input" + x-visible="{{$values.firstName === '123'}}" + required + /> + diff --git a/packages/next/src/space/main.scss b/packages/next/src/space/main.scss new file mode 100644 index 00000000000..e980ea0245a --- /dev/null +++ b/packages/next/src/space/main.scss @@ -0,0 +1,8 @@ +@import '~@alifd/next/lib/core/index-noreset.scss'; +@import '~@alifd/next/lib/form/scss/variable.scss'; + +$space-prefix-cls: '#{$css-prefix}space'; + +.#{$space-prefix-cls}-item:empty { + display: none !important; +} diff --git a/packages/next/src/space/style.ts b/packages/next/src/space/style.ts index d7b93271825..60a73b724ad 100644 --- a/packages/next/src/space/style.ts +++ b/packages/next/src/space/style.ts @@ -1 +1,2 @@ import '@alifd/next/lib/box/style' +import './main.scss' diff --git a/packages/next/src/style.ts b/packages/next/src/style.ts index 8b7f146cb85..6a16322895c 100644 --- a/packages/next/src/style.ts +++ b/packages/next/src/style.ts @@ -14,3 +14,4 @@ import './form/main.scss' import './preview-text/main.scss' import './select-table/main.scss' import './upload/main.scss' +import './space/main.scss'