Skip to content

Layout 布局

介绍

Layout 提供了 easy-roweasy-col 两个组件来进行行列布局。

按需引入

将components目录下easy-roweasy-col两个组件复制到你的项目conponents目录即可。

代码演示

基础用法

Layout 组件提供了 24列栅格,通过在 Col 上添加 span 属性设置列所占的宽度百分比,添加offset属性设置便宜量,添加gutter属性添加间距。

html
<easy-row>
  <easy-col :span="8">span: 8</easy-col>
  <easy-col :span="8">span: 8</easy-col>
  <easy-col :span="8">span: 8</easy-col>
</easy-row>

<easy-row>
  <easy-col :span="4">span: 4</easy-col>
  <easy-col :span="10" :offset="4">offset: 4, span: 10</easy-col>
</easy-row>

<easy-row>
  <easy-col  :span="12" :offset="12">offset: 12, span: 12</easy-col>
</easy-row>

<easy-row>
  <easy-col :span="8" :gutter="4">span: 8,gutter:4</easy-col>
  <easy-col :span="8" :gutter="4">span: 8,gutter:4</easy-col>
  <easy-col :span="8" :gutter="4">span: 8,gutter:4</easy-col>
</easy-row>
<easy-row>
  <easy-col :span="8">span: 8</easy-col>
  <easy-col :span="8">span: 8</easy-col>
  <easy-col :span="8">span: 8</easy-col>
</easy-row>

<easy-row>
  <easy-col :span="4">span: 4</easy-col>
  <easy-col :span="10" :offset="4">offset: 4, span: 10</easy-col>
</easy-row>

<easy-row>
  <easy-col  :span="12" :offset="12">offset: 12, span: 12</easy-col>
</easy-row>

<easy-row>
  <easy-col :span="8" :gutter="4">span: 8,gutter:4</easy-col>
  <easy-col :span="8" :gutter="4">span: 8,gutter:4</easy-col>
  <easy-col :span="8" :gutter="4">span: 8,gutter:4</easy-col>
</easy-row>

API

Col Props

参数说明类型默认值
span列元素宽度number-
offset列元素偏移距离number0
gutter列元素间距number0

Released under the MIT License.