fix(space): is shown when it has no children, closes #1605

This commit is contained in:
07akioni 2021-11-19 02:49:28 +08:00
parent cbaea28ea4
commit b1eb17d1d9
3 changed files with 3 additions and 0 deletions

View File

@ -18,6 +18,7 @@
### Fixes
- Fix the default value of the `suffix` internal component's `loading` property.
- Fix `n-space` is shown when it has no children, closes [#1605](https://github.com/TuSimple/naive-ui/issues/1605).
## 2.20.3 (2021-11-15)

View File

@ -18,6 +18,7 @@
### Fixes
- 修复 `suffix` 内部组件 `loading` 属性的默认值
- 修复 `n-space` 没有子节点的时候还被展示,关闭 [#1605](https://github.com/TuSimple/naive-ui/issues/1605).
## 2.20.3 (2021-11-15)

View File

@ -98,6 +98,7 @@ export default defineComponent({
mergedClsPrefix
} = this
const children = flatten(getSlot(this))
if (!children.length) return null
const horizontalMargin = `${margin.horizontal}px`
const semiHorizontalMargin = `${margin.horizontal / 2}px`
const verticalMargin = `${margin.vertical}px`