
# Layout 栅格布局
---
### 基础用法
通过基础的 24 分栏，迅速简便地创建布局
两个概念，行row和列col，具体使用方法如下
* 使用 ```row```在水平方向创建一行
* 将一组 ```col```插入在 ```row```中
* 在每个 ```col```中，键入自己的内容
* 通过设置 ```col```的 ```span```参数，指定跨越的范围，其范围是1到24
* 每个 ```row```中的 ```col```总和应该为24

<div class="demo-block">
  <div style="background:#eee;color:#fff;width:100%">
    <y-row type="flex" justify="center" align="top">
      <y-col span="3" style="background:#3c99fc">2栏布局</y-col>
      <y-col span="9" style="background:#3eb617">2栏布局</y-col>
    </y-row>
    <br>
    <y-row>
      <y-col span="8" style="background:#3c99fc">3栏布局</y-col>
      <y-col span="8" style="background:#3eb617">3栏布局</y-col>
      <y-col span="8" style="background:#3c99fc">3栏布局</y-col>
    </y-row>
    <br>
    <y-row :gutter="20">
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
      <y-col span="6"><div style="background:#3eb617">4栏布局</div></y-col>
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
      <y-col span="6"><div style="background:#3eb617">4栏布局</div></y-col>
    </y-row>
    <br>
    <y-row :gutter="20">
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
      <y-col span="6" offset="6"><div style="background:#3eb617">4栏布局,左边有偏格</div></y-col>
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
    </y-row>
  </div>
</div>

::: demo

```html
<template>
  <div style="background:#eee;color:#fff;width:600px">
    <y-row type="flex" justify="center" align="top">
      <y-col span="3" style="background:#3c99fc">2栏布局</y-col>
      <y-col span="9" style="background:green">2栏布局</y-col>
    </y-row>
    <br>
    <y-row>
      <y-col span="8" style="background:#3c99fc">3栏布局</y-col>
      <y-col span="8" style="background:#3eb617">3栏布局</y-col>
      <y-col span="8" style="background:#037dff">3栏布局</y-col>
    </y-row>
    <br>
    <y-row :gutter="20">
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
      <y-col span="6"><div style="background:#3eb617">4栏布局</div></y-col>
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
      <y-col span="6"><div style="background:#3eb617">4栏布局</div></y-col>
    </y-row>
    <br>
    <y-row :gutter="20">
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
      <y-col span="6" offset="6"><div style="background:#3eb617">4栏布局,左边有偏格</div></y-col>
      <y-col span="6"><div style="background:#3c99fc">4栏布局</div></y-col>
    </y-row>
  </div>
</template>
```
:::




### y-row 属性
| 属性      | 说明     | 类型      | 可选值        | 默认值   |
|---------- |--------  |---------- |-------------  |-------- |
| gutter      | 栅格间距，单位 px，左右平分 | String,Number |  --|  0  | 


### y-col 属性
| 属性      | 说明     | 类型      | 可选值        | 默认值   |
|---------- |--------  |---------- |-------------  |-------- |
| span | 栅格的占位格数，可选值为0~24的整数 | String,Number |  --|  0  | 
|offset|栅格左侧的间隔格数，可选值为1~24的整数 | String,Number|  --|0| 



