Skip to content

Waterfall 瀑布流

瀑布流/砌体布局组件,支持多列不均匀排列,常用于图片列表、商品展示等场景。

平台兼容性

App(vue)App(nvue)H5小程序

代码示例

基础用法

html
<see-waterfall :list="list" />

3 列瀑布流

html
<see-waterfall :list="list" :columns="3" gap="12rpx" />

自定义项插槽

html
<see-waterfall :list="list">
  <template #item="{ item }">
    <view class="custom-item">
      <image :src="item.image" mode="widthFix" />
      <text>{{ item.title }}</text>
    </view>
  </template>
</see-waterfall>

加载更多

html
<see-waterfall :list="list" has-more @on-load-more="onLoadMore" />

API

Props

参数说明类型默认值可选值
list瀑布流数据WaterfallItem[][]-
columns列数number2-
gap列间距string'16rpx'CSS 间距值
hasMore是否显示加载更多booleanfalsetrue / false

WaterfallItem

参数说明类型默认值
id唯一标识string | number-
image图片 URLstring-
title标题string-
height高度(用于预分配空间,单位 rpx)number-

Events

事件名说明回调参数
onLoadMore加载更多时触发-
onClick点击项时触发(item: WaterfallItem, index: number)

Slots

名称说明作用域
item自定义每一项{ item, index }
footer自定义底部加载区域-

辽 ICP 备 2025070134 号