Skip to content

MetaRow 结构行

用于构建「左侧区块 + 中间上下信息 + 右侧区块」的通用行布局,适合账单、消息列表、联系人、订单条目等移动端高频场景。

基础用法

vue
<lk-meta-row :gap="16" :main-gap="6">
  <template #start>
    <lk-avatar shape="rounded" size="72" icon="person-fill" />
  </template>
  <template #main-top>
    <text>主标题</text>
  </template>
  <template #main-bottom>
    <text>副标题</text>
  </template>
  <template #end>
    <text>-$12.88</text>
  </template>
</lk-meta-row>

固定左右宽度

vue
<lk-meta-row :start-width="72" :end-width="140" :gap="16">
  <template #start>
    <lk-avatar shape="rounded" size="72" icon="music-note-beamed" />
  </template>
  <template #main-top>
    <text>Spotify</text>
  </template>
  <template #main-bottom>
    <text>Yesterday</text>
  </template>
  <template #end>
    <text>-$90.40</text>
  </template>
</lk-meta-row>

推荐示例

1) 直接复用项目 Demo(推荐)

vue
<script setup lang="ts">
import MetaRowDemo from '@/components/demos/meta-row-demo.vue'
</script>

<template>
  <MetaRowDemo />
</template>

2) 在业务页中按需组合

vue
<template>
  <view class="page-demo">
    <lk-meta-row />
  </view>
</template>

API

Props

参数说明类型默认值
align左中右三栏的垂直对齐方式start | center | endcenter
gap左中右三栏水平间距string | number16
mainGap中间上下区域垂直间距string | number2
startWidth左侧区域固定宽度string | number''
endWidth右侧区域固定宽度string | number''

Events

当前版本未额外暴露自定义事件。

Slots

插槽名说明
start左侧区域(头像/图标/缩略图)
main-top中间上区域(标题)
main-bottom中间下区域(描述)
end右侧区域(金额/状态/时间)

使用建议

TIP

当中间标题或副标题较长时,建议在插槽内部文本上增加省略样式,避免挤压右侧信息区。

WARNING

startWidthendWidth 仅控制左右区域,不会自动限制插槽内部子元素宽度;超宽内容需要在插槽内自行约束。

基于 MIT 协议开源 · 粤ICP备2022114240号-3

MetaRow 结构行

正在连接预览服务...

请先运行 pnpm run dev:h5