amis2/docs/zh-CN/components/grid.md

60 lines
2.1 KiB
Markdown
Raw Normal View History

2020-07-28 10:03:53 +08:00
---
title: Grid 水平布局
2020-07-29 16:20:21 +08:00
description:
2020-07-28 10:03:53 +08:00
type: 0
group: ⚙ 组件
menuName: Grid 组件
2020-07-29 16:20:21 +08:00
icon:
2020-07-28 10:03:53 +08:00
order: 46
---
2020-07-29 16:20:21 +08:00
2020-07-28 10:03:53 +08:00
## 基本用法
```schema: scope="body"
2020-07-28 10:03:53 +08:00
[
{
"type": "grid",
"className": "b-a bg-dark lter",
"columns": [
{
2021-07-29 23:45:32 +08:00
"md": 0,
"body": [
{
"type": "plain",
"text": "md: 3",
"className": "b-r"
}
]
},
2020-07-28 10:03:53 +08:00
{
2021-07-29 23:45:32 +08:00
"md": 9,
"body": [
{
"type": "plain",
"text": "md: 9"
}
]
2020-07-28 10:03:53 +08:00
}
]
}
]
```
## 属性表
| 属性名 | 类型 | 默认值 | 说明 |
| -------------------------- | ----------------------------------------- | -------- | -------------------- |
| type | `string` | `"grid"` | 指定为 Grid 渲染器 |
| className | `string` | | 外层 Dom 的类名 |
| columns | `Array` | | 列集合 |
| columns[x] | [SchemaNode](../../docs/types/schemanode) | | 成员可以是其他渲染器 |
2021-07-29 23:45:32 +08:00
| columns[x].xs | `int` or "auto" | | 宽度占比: 1 - 12 |
| columns[x].columnClassName | | | 列类名 |
2021-07-29 23:45:32 +08:00
| columns[x].sm | `int` or "auto" | | 宽度占比: 1 - 12 |
| columns[x].md | `int` or "auto" | | 宽度占比: 1 - 12 |
| columns[x].lg | `int` or "auto" | | 宽度占比: 1 - 12 |
2020-07-28 10:03:53 +08:00
更多使用说明,请参看 [Grid Props](https://react-bootstrap.github.io/layout/grid/#col-props)