Skip to content

Space 间距

设置组件之间的间距。

基础用法

vue
<template>
  <x-space>
    <x-button>Button 1</x-button>
    <x-button>Button 2</x-button>
    <x-button>Button 3</x-button>
  </x-space>
</template>

<script setup>
import { Space, Button } from '@xto/base'
</script>

垂直间距

使用 direction 属性设置排列方向。

vue
<template>
  <x-space direction="vertical">
    <x-button>Button 1</x-button>
    <x-button>Button 2</x-button>
  </x-space>
</template>

间距大小

使用 size 属性设置间距大小。

Small:
Default:
Large:
vue
<template>
  <x-space size="small">
    <x-button>Small</x-button>
    <x-button>Small</x-button>
  </x-space>

  <x-space size="large">
    <x-button>Large</x-button>
    <x-button>Large</x-button>
  </x-space>
</template>

API

Props

属性说明类型默认值
direction排列方向'horizontal' | 'vertical''horizontal'
size间距大小'small' | 'default' | 'large' | number'default'
wrap是否换行booleantrue
align对齐方式'start' | 'center' | 'end''center'

基于 MIT 许可发布