# Grid グリッド

24 列のグリッドシステムです。LhRow が並び方と間隔を、LhCol がスパン、オフセット、レスポンシブブレイクポイントを担います。

グリッド
<template>
  <div>
    <p class="demo-note">基本グリッド(24 列)+ gutter 間隔</p>
    <LhRow :gutter="16">
      <LhCol :span="8"><div class="grid-cell">span=8</div></LhCol>
      <LhCol :span="8"><div class="grid-cell">span=8</div></LhCol>
      <LhCol :span="8"><div class="grid-cell">span=8</div></LhCol>
    </LhRow>
    <p class="demo-note">offset / push / pull</p>
    <LhRow :gutter="12">
      <LhCol :span="6" :offset="6"><div class="grid-cell">offset=6</div></LhCol>
      <LhCol :span="6" :push="6"><div class="grid-cell">push=6</div></LhCol>
    </LhRow>
    <p class="demo-note">整列:justify / align</p>
    <LhRow
      justify="center"
      align="middle"
      style="height: 60px; background: var(--lh-bg-color-page, #f6f1ea); border-radius: 6px"
    >
      <LhCol :span="6"><div class="grid-cell">中央寄せ</div></LhCol>
    </LhRow>
    <p class="demo-note">レスポンシブブレイクポイント::sizes=&#123; xs: 24, sm: 12, md: 8 &#125;</p>
    <LhRow :gutter="12">
      <LhCol v-for="i in 6" :key="i" :sizes="{ xs: 24, sm: 12, md: 8 }">
        <div class="grid-cell">レスポンシブ列 {{ i }}</div>
      </LhCol>
    </LhRow>
  </div>
</template>

ヒント

demo の .grid-cell はサンプル用のスタイル(灰背景・角丸)であり、ライブラリ自身は提供しません。

# Row Props

プロパティ 説明 型 デフォルト値
justify 主軸の並べ方 'start' \| 'end' \| 'center' \| 'space-between' \| 'space-around' 'start'
align クロス軸の整列 'top' \| 'middle' \| 'bottom' 'top'
gutter 列間の間隔(px または [横, 縦]) number \| [number, number] 0
wrap 折り返しを許可 boolean true
sx sx によるレイアウト省略記法 — —

# Col Props

プロパティ 説明 型 デフォルト値
span 占める列数(24 グリッド制) number —
offset 左側のオフセット列数 number 0
push 右への移動列数 number 0
pull 左への移動列数 number 0
xs / sm / md / lg / xl ブレイクポイントごとのスパン:<640 / ≥640 / ≥768 / ≥1024 / ≥1280px number —
sizes ブレイクポイントごとに一括宣言(xs~xl と等価) { xs?, sm?, md?, lg?, xl? } —
sx sx によるレイアウト省略記法 — —

Copyright © 2024-2026 FengMo WenXue