Skip to content

Commit

Permalink
fix: missing size validator
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin authored and binbin committed Aug 25, 2023
1 parent 06287ea commit 0f657ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/varlet-ui/src/space/Space.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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'
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({
Expand All @@ -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)

Expand Down

0 comments on commit 0f657ec

Please sign in to comment.