1 | import { ComponentType } from 'react'
|
2 | import { StandardProps, CommonEventFunction } from './common'
|
3 | interface GridBuilderProps extends StandardProps {
|
4 | /**
|
5 | * 布局方式
|
6 | * @supported weapp
|
7 | * @default "aligned"
|
8 | *
|
9 | * 可选值:
|
10 | * - aligned: 每行高度由同一行中最大高度子节点决定
|
11 | * - masonry: 瀑布流,根据子元素高度自动布局
|
12 | */
|
13 | type: 'aligned' | 'masonry'
|
14 | /**
|
15 | * 需要用于渲染的列表
|
16 | * @supported weapp
|
17 | * @default []
|
18 | */
|
19 | list: any[]
|
20 | /**
|
21 | * 完整列表的长度,如果不传则取 list 的长度作为其值
|
22 | * @supported weapp
|
23 | */
|
24 | childCount?: number
|
25 | /**
|
26 | * 交叉轴元素数量
|
27 | * @supported weapp
|
28 | * @default 2
|
29 | */
|
30 | crossAxisCount?: number
|
31 | /** 交叉轴元素最大范围
|
32 | * @supported weapp
|
33 | * @default 0
|
34 | */
|
35 | maxCrossAxisExtent?: number
|
36 | /**
|
37 | * 主轴方向间隔
|
38 | * @supported weapp
|
39 | * @default 0
|
40 | */
|
41 | mainAxisGap?: number
|
42 | /** 交叉轴方向间隔
|
43 | * @supported weapp
|
44 | * @default 0
|
45 | */
|
46 | crossAxisGap?: number
|
47 | /**
|
48 | * 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距
|
49 | * @supported weapp
|
50 | * @default [0, 0, 0, 0]
|
51 | */
|
52 | padding?: [number, number, number, number]
|
53 | /**
|
54 | * 列表项创建时触发,event.detail = {index},index 即被创建的列表项序号
|
55 | * @supported weapp
|
56 | */
|
57 | onItemBuild?: CommonEventFunction
|
58 | /**
|
59 | * 列表项回收时触发,event.detail = {index},index 即被回收的列表项序号
|
60 | * @supported weapp
|
61 | */
|
62 | onItemDispose?: CommonEventFunction
|
63 | }
|
64 |
|
65 | /**
|
66 | * 网格构造器,仅支持作为 `<scroll-view type="custom">` 模式的直接子节点,仅 Skyline 支持。
|
67 | * @classification skyline
|
68 | * @supported weapp
|
69 | * @see https://developers.weixin.qq.com/miniprogram/dev/component/grid-builder.html
|
70 | */
|
71 | declare const GridBuilder: ComponentType<GridBuilderProps>
|
72 | export { GridBuilder, GridBuilderProps }
|