Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit 2a5a64c

Browse files
committed
refactor(ui/space): modify style in space (#62)
1 parent 374c00f commit 2a5a64c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/varlet-vue2-ui/src/space/Space.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const getSize = (size, isInternalSize) => {
1717
return isInternalSize ? internalSizes[size] : isArray(size) ? size.map(toPxNum) : [toPxNum(size), toPxNum(size)]
1818
}
1919

20+
const padStartFlex = (style) => {
21+
return style === 'start' || style === 'end' ? `flex-${style}` : style
22+
}
23+
2024
export default defineComponent({
2125
name: 'VarSpace',
2226

@@ -64,8 +68,8 @@ export default defineComponent({
6468
class={['var-space', 'var--box', inline ? 'var-space--inline' : null]}
6569
style={{
6670
flexDirection: direction,
67-
justifyContent: justify,
68-
alignItems: align,
71+
justifyContent: padStartFlex(justify),
72+
alignItems: padStartFlex(align),
6973
flexWrap: wrap ? 'wrap' : 'nowrap',
7074
margin: direction === 'row' ? `-${y / 2}px 0` : undefined,
7175
}}

0 commit comments

Comments
 (0)