组件
便当格 Bento
Bento:不等宽磁贴网格。整体呈现为一个版面;容器决定轨道数量,每个单元格自行声明跨度。
#基础用法
Wide
A tile that claims two tracks
Tall? No — square
One track of measure
Compact
One track
Compact
One track
<script setup lang="ts">
import { Bento, Card } from "@bysages/vue";
const tiles = [
{ span: 2, title: "Wide", note: "A tile that claims two tracks" },
{ span: 1, title: "Tall? No — square", note: "One track of measure" },
{ span: 1, title: "Compact", note: "One track" },
{ span: 1, title: "Compact", note: "One track" },
];
</script>
<template>
<Bento class="w-full">
<Bento.Cell v-for="(tile, i) in tiles" :key="`${tile.title}-${i}`" :span="tile.span">
<Card class="h-full p-4">
<h3 class="m-0 text-sm font-medium">{{ tile.title }}</h3>
<p class="mb-0 mt-1 text-xs text-tertiary">{{ tile.note }}</p>
</Card>
</Bento.Cell>
</Bento>
</template>
#属性
#SBentoRoot
Bento:不等宽磁贴网格。整体呈现为一个版面;容器决定轨道数量,每个单元格自行声明跨度。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
columns | Number | 3 | — |
#SBentoCell
Bento 单元格。span 设置跨列数,rowSpan 设置跨行数;整体布局仍由网格保持对齐。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
span | Number | 1 | — |
rowSpan | Number | 1 | — |