# Space 間距
為相鄰元素加入間距的佈局容器。支援水平 / 垂直方向、預設檔位與自訂間距、換行與對齊。
間距
<template>
<div class="demo-col">
<p class="demo-note">水平方向 + 預設間距</p>
<LhSpace>
<LhButton>水墨</LhButton>
<LhButton>花鳥</LhButton>
<LhButton>人物</LhButton>
</LhSpace>
<p class="demo-note">垂直方向</p>
<LhSpace direction="vertical">
<LhButton>水墨</LhButton>
<LhButton>花鳥</LhButton>
</LhSpace>
<p class="demo-note">自訂間距 + 換行</p>
<LhSpace :size="24" wrap>
<LhTag v-for="item in items" :key="item">{{ item }}</LhTag>
</LhSpace>
<p class="demo-note">對齊方式 alignment=start</p>
<LhSpace alignment="start">
<LhButton>短</LhButton>
<div style="height: 48px; padding: 12px; border: 1px dashed var(--lh-border-color)">高塊</div>
</LhSpace>
</div>
</template>
<script>
export default {
data: () => ({ items: ['水墨', '花鳥', '人物', '工筆', '寫意', '沒骨'] }),
}
</script>
# Props
| 屬性 | 說明 | 類型 | 預設值 |
|---|---|---|---|
| direction | 排列方向 | 'horizontal' \| 'vertical' | 'horizontal' |
| size | 間距:預設檔位 / 像素數字 / [水平, 垂直] | 'small' \| 'medium' \| 'large' \| number \| [number, number] | 'medium' |
| wrap | 允許換行(僅水平方向) | boolean | false |
| alignment | 交叉軸對齊 | 'start' \| 'center' \| 'end' \| 'baseline' | 'center' |
| sx | sx 快速佈局屬性 | — | — |
← Divider 分隔線 Card 卡片 →
Copyright © 2024-2026 风默文学 | 宁ICP备2024006574号 |
苏公网安备32040002010537