From 68c8dc8e4607f66b0bc7346866a0fc54d8b91ae8 Mon Sep 17 00:00:00 2001 From: jeremywu <15975785+JeremyWuuuuu@users.noreply.github.com> Date: Thu, 15 Apr 2021 11:33:52 +0800 Subject: [PATCH] fix(space): fix/1839-el-space-string-spacer-style-issue (#1845) - Fix the issue causing horizontal layout spacer styling weird --- packages/space/src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/space/src/index.ts b/packages/space/src/index.ts index 9be52ba333..4239f1988a 100644 --- a/packages/space/src/index.ts +++ b/packages/space/src/index.ts @@ -34,6 +34,7 @@ export default defineComponent({ itemStyle, spacer, prefixCls, + direction, } = ctx const children = renderSlot($slots, 'default', { key: 0 }, () => []) @@ -103,11 +104,11 @@ export default defineComponent({ // when the spacer inherit the width from the // parent, this span's width was not set, so space // might disappear - { style: [itemStyle, 'width: 100%'], key: idx }, + { style: [itemStyle, direction === 'vertical' ? 'width: 100%' : null], key: idx }, [ - // if spacer is already a valid vnode, then append it to the current - // span element. - // otherwise, treat it as string. + // if spacer is already a valid vnode, then append it to the current + // span element. + // otherwise, treat it as string. isVNode(spacer) ? spacer : createTextVNode(spacer as string, PatchFlags.TEXT),