Skip to content

Commit

Permalink
fix(components): [space] missing empty string size (#8039)
Browse files Browse the repository at this point in the history
Co-authored-by: 三咲智子 <sxzz@sxzz.moe>
  • Loading branch information
HeftyKoo and sxzz committed Jun 22, 2022
1 parent 7097940 commit 8f0341b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/components/space/src/use-space.ts
Expand Up @@ -4,13 +4,12 @@ import { useNamespace } from '@element-plus/hooks'

import type { SpaceProps } from './space'
import type { CSSProperties, StyleValue } from 'vue'
import type { ComponentSize } from '@element-plus/constants'

const SIZE_MAP = {
small: 8,
default: 12,
large: 16,
} as Record<ComponentSize, number>
} as const

export function useSpace(props: SpaceProps) {
const ns = useNamespace('space')
Expand Down Expand Up @@ -57,7 +56,7 @@ export function useSpace(props: SpaceProps) {
if (isNumber(size)) {
val = size
} else {
val = SIZE_MAP[size] || SIZE_MAP.small
val = SIZE_MAP[size || 'small'] || SIZE_MAP.small
}

if ((wrap || fill) && dir === 'horizontal') {
Expand Down

0 comments on commit 8f0341b

Please sign in to comment.