说明
容器型区块,注册在
常见能力:
- 每个子区块即一格,全部并置于同一 CSS 网格(不止两区)
- columns 键指定等宽列数,留空按 minmax(280px) 自适应铺满
- 各格由 PageRenderer 递归渲染,可混排表格 / 列表 / 图表 / 指标等
- 容器组件:设计态空网格给出放置占位、支持继续拖放
- 经 PageComponents 注册表按键 grid 引用,与已发布页面 JSON 解耦
- 标题本地化、样式随 data-theme 明暗切换
用法
@* 每个子区块一格;columns=2 时两列等宽,留空自适应铺满 *@
@{ var grid = new PageBlock
{
Component = "grid",
Title = "经营看板",
Settings = { ["columns"] = "2" },
Children =
{
new PageBlock { Component = "table", Title = "订单",
Settings = { ["columns"] = "单号,客户,金额", ["rows"] = "3" } },
new PageBlock { Component = "chart", Title = "按状态",
Settings = { ["type"] = "pie", ["series"] = "42,68,55", ["labels"] = "待办,进行,完成" } },
new PageBlock { Component = "list", Title = "最新动态",
Settings = { ["count"] = "4" } },
},
}; }
<GridPage Block="grid" Design="false" />
API 参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
Block |
PageBlock |
PageBlock |
区块数据:子区块即栅格单元,列数取 Settings["columns"]。 |
Design |
bool |
false |
是否设计态。 |
所有组件均继承
BaseComponent,除上表参数外还支持Class、Style、Disabled、Visible。
扫码关注公众号
扫码加入 QQ 群