Skip to content

Layout 布局

基础布局

使用 yl-row 和 yl-col 组件进行布局,有 24 分栏

分栏间隔

使用 yl-row 的 gutter 属性来设置分栏间隔

混合布局

列偏移

通过指定 yl-col 的 offset 属性,指定偏移的栏数

对齐方式

设置 yl-row 的 justify 属性定义子元素的排列方式,有 start,center,end,space-between,space-around。

响应式布局

主要设置了五个尺寸,xs、sm、md、lg 和 xl。

Row API

Row Attributes

属性名说明类型默认值可选值
justify水平排列方式string'start''start' | 'end' | 'center' | 'space-between' | 'space-around'
gutter栅栏间隔number
tag自定义元素标签stringdiv

Row Slots

插槽名说明子标签
default自定义默认内容Col

Col API

Col Attributes

属性名说明类型默认值可选值
span栅栏所占列数number240-24
offset左侧偏移栅栏数number0
tag自定义元素标签stringdiv
xs<768px 时的栅栏所占列数number
sm>=768px 时的栅栏所占列数number
md>=992px 时的栅栏所占列数number
lg>=1200px 时的栅栏所占列数number
xl>=1920px 时的栅栏所占列数number

Col Slots

插槽名说明子标签
default自定义默认内容

Released under the MIT License.