Skip to content

图片展示 ​

用于一行一图或 1–4 列图片网格。图片项点击通过 link service 跳转。

完整信封 ​

ts
{
    component: 'v2.images', text: '图片展示', type: '3-1', active: true,
    props: {
        layout: { mode: 'single', columns: 2 },
        style: { heightMode: 'auto', height: 200, pageMargin: 0, imageRadius: 0, backgroundColor: '#FFFFFF', gap: 8 },
        items: [{ id: 'image-1', src: 'https://example.com/a.png', link: { httpType: 10, http: '/pages/a' } }]
    }
}

Props ​

字段类型默认值说明
layout.mode'single' | 'grid''single'单列或网格
layout.columns1 | 2 | 3 | 42网格列数
style.*共享图片样式-高度、边距、圆角和背景
style.gapnumber8图片间距,rpx
itemsCmsV2ImageItem[][]图片、ID 和链接

single 模式忽略 columns。

为 uni-app 商城与 CMS 场景设计