Row 布局
组件类型:UxRowComponentPublicInstance
平台兼容性
Android uni-app-x | iOS uni-app-x | web | 小程序 |
---|---|---|---|
√ | x | x | x |
Props
属性名 | 类型 | 默认值 | 说明 |
---|---|---|---|
gutter | Number | 0 | 栅格间隔 |
justify | String | 'left' | 水平排列方式 |
align | String | 'center' | 垂直对齐方式 |
justify
值 | 说明 |
---|---|
left | 左对齐 |
center | 居中对齐 |
right | 右对齐 |
around | 间隔相等 |
between | 两端对齐 |
align
值 | 说明 |
---|---|
top | 上对齐 |
center | 居中 |
bottom | 下对齐 |
stretch | 填充 |
Events
事件名 | 说明 | 参数 |
---|---|---|
click | 点击事件 | event: MouseEvent |
示例代码
html
<template>
<ux-page :colors="['white']">
<ux-navbar title="Layout" :border="false"></ux-navbar>
<ux-scroll :scroll-y="true">
<ux-col :padding="[15]">
<ux-text theme="title" text="基础"></ux-text>
<ux-row :mt="10">
<ux-col :flex="false" :span="6">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="6">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
<ux-row :mt="10">
<ux-col :flex="false" :span="4">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="4">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="4">
<view class="cell bg-light"></view>
</ux-col>
</ux-row>
<ux-row :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-light"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="分栏间隔"></ux-text>
<ux-row justify="between" :gutter="10" :mt="10">
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg-light"></view>
</ux-col>
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="混合布局"></ux-text>
<ux-row :gutter="10" :mt="10">
<ux-col :flex="false" :span="2" :gutter="10">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="4" :gutter="10">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="6" :gutter="10">
<view class="cell bg-light"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="分栏偏移"></ux-text>
<ux-row justify="between" :mt="10">
<ux-col :flex="false" :span="3" :offset="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
<ux-row :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3" :offset="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="对齐方式"></ux-text>
<ux-row justify="between" :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
<ux-row justify="around" :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-placeholder :height="50"></ux-placeholder>
</ux-scroll>
</ux-page>
</template>
<template>
<ux-page :colors="['white']">
<ux-navbar title="Layout" :border="false"></ux-navbar>
<ux-scroll :scroll-y="true">
<ux-col :padding="[15]">
<ux-text theme="title" text="基础"></ux-text>
<ux-row :mt="10">
<ux-col :flex="false" :span="6">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="6">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
<ux-row :mt="10">
<ux-col :flex="false" :span="4">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="4">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="4">
<view class="cell bg-light"></view>
</ux-col>
</ux-row>
<ux-row :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-light"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="分栏间隔"></ux-text>
<ux-row justify="between" :gutter="10" :mt="10">
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg-light"></view>
</ux-col>
<ux-col :flex="false" :span="3" :gutter="10">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="混合布局"></ux-text>
<ux-row :gutter="10" :mt="10">
<ux-col :flex="false" :span="2" :gutter="10">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="4" :gutter="10">
<view class="cell bg-dark"></view>
</ux-col>
<ux-col :flex="false" :span="6" :gutter="10">
<view class="cell bg-light"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="分栏偏移"></ux-text>
<ux-row justify="between" :mt="10">
<ux-col :flex="false" :span="3" :offset="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
<ux-row :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3" :offset="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-col :padding="[15]">
<ux-text theme="title" text="对齐方式"></ux-text>
<ux-row justify="between" :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
<ux-row justify="around" :mt="10">
<ux-col :flex="false" :span="3">
<view class="cell bg"></view>
</ux-col>
<ux-col :flex="false" :span="3">
<view class="cell bg-dark"></view>
</ux-col>
</ux-row>
</ux-col>
<ux-placeholder :height="50"></ux-placeholder>
</ux-scroll>
</ux-page>
</template>
ts
<script>
export default {
data() {
return {
}
},
onLoad(e: OnLoadOptions) {
},
methods: {
}
}
</script>
<script>
export default {
data() {
return {
}
},
onLoad(e: OnLoadOptions) {
},
methods: {
}
}
</script>
css
<style lang="scss">
.cell {
height: 45rpx;
border-radius: 10rpx;
}
.bg {
background: #ced7e1;
}
.bg-light {
background: #e5e9f2;
}
.bg-dark {
background: #99a9bf;
}
</style>
<style lang="scss">
.cell {
height: 45rpx;
border-radius: 10rpx;
}
.bg {
background: #ced7e1;
}
.bg-light {
background: #e5e9f2;
}
.bg-dark {
background: #99a9bf;
}
</style>