Col (纵向布局)
默认 flex 纵向布局。Layout 分栏布局重要子组件
支持平台
安卓 | ios | 鸿蒙 | web | 微信小程序 |
---|---|---|---|---|
√ | √ | √ | √ | √ |
示例代码
html
<template>
<t-page main-class="p-30">
<t-card title='Layout 分栏布局' sub-title="分栏布局组件提供灵活的栅格系统支持,通过简单的属性配置即可实现响应式列宽、偏移和间隔,实现简洁高效的页面布局。"></t-card>
<t-section title="示例" main-class="mtb-30"></t-section>
<t-row main-class="mb-15">
<t-col :span="8">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">8</t-text></t-row>
</t-col>
<t-col :span="8">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">8</t-text></t-row>
</t-col>
<t-col :span="8">
<t-row main-class="w-100% h-60px fc tdb-s"> <t-text main-class="c-#fff">8</t-text></t-row>
</t-col>
</t-row>
<t-row main-class="mb-15">
<t-col :span="6">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
<t-col :span="6">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
<t-col :span="6">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
<t-col :span="6">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
</t-row>
<t-row main-class="mb-15">
<t-col :span="8">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">8</t-text></t-row>
</t-col>
<t-col :span="16">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">16</t-text></t-row>
</t-col>
</t-row>
<t-section title="分栏偏移" main-class="mtb-30"></t-section>
<t-row main-class="mb-15">
<t-col :span="5">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">5</t-text></t-row>
</t-col>
<t-col :span="5" :offset="2">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">5</t-text></t-row>
</t-col>
<t-col :span="7" :offset="5">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">7</t-text></t-row>
</t-col>
</t-row>
<t-section title="间距" main-class="mtb-30"></t-section>
<t-row>
<t-col :span="6" :gutter="6">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
<t-col :span="6" :gutter="6">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
<t-col :span="6" :gutter="6">
<t-row main-class="w-100% h-60px fc tdb-e"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
<t-col :span="6" :gutter="6">
<t-row main-class="w-100% h-60px fc tdb-s"><t-text main-class="c-#fff">6</t-text></t-row>
</t-col>
</t-row>
</t-page>
</template>
属性
名称 | 类型 | 默认值 | 说明 | 可选值 |
---|---|---|---|---|
size | String | mini | 组件尺寸 | large(大尺寸), medium(中尺寸), small(小尺寸), mini(迷你) |
type | String | "" | 组件类型 | info(信息), primary(正常), error(错误), warning(警告), success(成功) |
disabled | Boolean | false | 组件是否禁用 | false, true |
stop | Boolean | false | 是否阻止事件冒泡(Tui统一写法处理事件冒泡) | false, true |
hover | Boolean | true | 是否有点击效果 | false, true |
path | String | "" | 点击组件后跳转的页面路径,如果为空则响应点击事件,如果不为空则跳转页面不会响应单击事件。 | - |
mainClass | String | "" | 组件根节点的样式 | - |
nativeClass | String | "" | 组件根节点原生样式 | - |
effect | String | "normal" | 组件显示主题 | normal(正常), dark(深色), light(浅色), plain(镂空) |
offset | Number | 1 | 列的偏移量,单位为百分比 | |
gutter | Number | 1 | 列间距,单位为像素 | |
span | Number | 1 | 列的宽度,单位为百分比 |
事件
名称 | 返回参数 | 说明 |
---|---|---|
click | (e : UniPointerEvent) | - |
插槽
名称 | 返回值 | 说明 |
---|---|---|
default | - |