From 0f657ecfeaf05de9de0959cafd19caf00003cb76 Mon Sep 17 00:00:00 2001 From: binbin Date: Fri, 25 Aug 2023 14:55:58 +0800 Subject: [PATCH] fix: missing size validator --- packages/varlet-ui/src/space/Space.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/varlet-ui/src/space/Space.tsx b/packages/varlet-ui/src/space/Space.tsx index df4a577bef3..b7da9007b41 100644 --- a/packages/varlet-ui/src/space/Space.tsx +++ b/packages/varlet-ui/src/space/Space.tsx @@ -1,5 +1,5 @@ import { defineComponent, VNodeChild } from 'vue' -import { internalSizeValidator, props, type SpaceSize } from './props' +import { props, type SpaceSize } from './props' import { isArray } from '@varlet/shared' import { call, createNamespace, flatFragment } from '../utils/components' import { padStartFlex, toSizeUnit } from '../utils/elements' @@ -7,6 +7,8 @@ import { computeMargin } from './margin' import '../styles/common.less' import './space.less' +const isInternalSize = (size: any) => ['mini', 'small', 'normal', 'large'].includes(size) + const { n, classes } = createNamespace('space') export default defineComponent({ @@ -23,8 +25,7 @@ export default defineComponent({ return () => { const { inline, justify, align, wrap, direction, size } = props let children: VNodeChild[] = call(slots.default) ?? [] - const isInternalSize = internalSizeValidator(size) - const [y, x] = getSize(size, isInternalSize) + const [y, x] = getSize(size, isInternalSize(size)) children = flatFragment(children)