Grid
v2 插件界面组件 Grid(布局)的属性、子节点与示例
分组:布局 · 子节点:任意多个子节点
属性
| 属性 | 类型 |
|---|---|
columns | JSON |
gap | 0 · 1 · 2 · 3 · 4 · 6 · 8 |
rowGap | 0 · 1 · 2 · 3 · 4 · 6 · 8 |
另有所有组件都有的通用属性。动作类型的属性写动作名,或 { action, args }。
示例
组件画廊和两端比对用的就是这棵树:
代码代码代码json
{
"type": "Grid",
"props": {
"columns": 3,
"gap": "3"
},
"children": [
{
"type": "Box",
"props": {
"surface": "card",
"padding": "3"
},
"children": [
{
"type": "Text",
"props": {
"value": "Cell 1"
}
}
]
},
{
"type": "Box",
"props": {
"surface": "card",
"padding": "3"
},
"children": [
{
"type": "Text",
"props": {
"value": "Cell 2"
}
}
]
},
{
"type": "Box",
"props": {
"surface": "card",
"padding": "3"
},
"children": [
{
"type": "Text",
"props": {
"value": "Cell 3"
}
}
]
},
{
"type": "Box",
"props": {
"surface": "card",
"padding": "3"
},
"children": [
{
"type": "Text",
"props": {
"value": "Cell 4"
}
}
]
},
{
"type": "Box",
"props": {
"surface": "card",
"padding": "3"
},
"children": [
{
"type": "Text",
"props": {
"value": "Cell 5"
}
}
]
},
{
"type": "Box",
"props": {
"surface": "card",
"padding": "3"
},
"children": [
{
"type": "Text",
"props": {
"value": "Cell 6"
}
}
]
}
]
}