Skip to content
本页导读

Row

组件类型:UxRowComponentPublicInstance

平台兼容性

UniApp X

AndroidiOSweb鸿蒙 Next小程序
x

UniApp Vue Nvue

AndroidiOSweb鸿蒙 Next小程序
xxxx

Props

属性名类型默认值说明
flexBooleanfalse弹性盒子
gutterAny0栅格间隔
justifyStringleft水平排列方式
alignStringcenter垂直对齐方式
marginArray边距[上右下左][上下左右][上下左右]
mtAny距上单位px
mrAny距右单位px
mbAny距下单位px
mlAny距左单位px
paddingArray填充[上右下左][上下左右][上下左右]
ptAny上内边距单位px
prAny右内边距单位px
pbAny下内边距单位px
plAny左内边距单位px
xstyleArray自定义样式

justify

说明
left左对齐
right右对齐
center居中
around间隔相等
between两端对齐

align

说明
top上对齐
center居中
bottom下对齐
stretch填充

Events

事件名说明参数
click被点击时触发

示例代码

html
<template>
	<ux-page :stack="showDoc">
		<ux-navbar :title="title" :bold="true">
			<template v-slot:right>
				<!-- #ifndef MP -->
				<ux-button theme="text" icon="/static/tip.png" :icon-size="22" @click="onDoc()"></ux-button>
				<!-- #endif -->
			</template>
		</ux-navbar>
		
		<ux-scroll>
			<ux-card direction="column" icon="flag-filled" title="布局" :bold="true">
				<ux-text text="支持配置分栏间隔、分栏偏移、对齐方式"></ux-text>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="栅格" :bold="true">
				<ux-text text="共有12栅格,任意分配,只有 flex=false 时才能开启分栏" :mb="15"></ux-text>
				<ux-col>
					<ux-row>
						<ux-col :flex="false" :span="2">
							<view class="cell bg">
								<ux-text text="2"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="10">
							<view class="cell bg-dark">
								<ux-text text="10"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row :mt="10">
						<ux-col :flex="false" :span="4">
							<view class="cell bg">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="4">
							<view class="cell bg-dark">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="4">
							<view class="cell bg-light">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="分栏间隔" :bold="true">
				<ux-text text="支持配置分栏间隔" :mb="15"></ux-text>
				<ux-col>
					<ux-row justify="between" :gutter="10">
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg-light">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row :gutter="10" :mt="10">
						<ux-col :flex="false" :span="2" :gutter="10">
							<view class="cell bg">
								<ux-text text="2"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="4" :gutter="10">
							<view class="cell bg-dark">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="6" :gutter="10">
							<view class="cell bg-light">
								<ux-text text="6"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="分栏偏移" :bold="true">
				<ux-text text="支持设置分栏偏移量" :mb="15"></ux-text>
				<ux-col>
					<ux-row justify="between" :mt="10">
						<ux-col :flex="false" :span="3" :offset="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :offset="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="对齐" :bold="true">
				<ux-text text="支持 justify 和 align 对齐方式" :mb="15"></ux-text>
				<ux-col>
					<ux-row justify="between" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row justify="around" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row justify="left" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row justify="right" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-placeholder :height="200">
				<ux-row justify="center" align="center" style="height: 100%;">
					<ux-text prefix-icon="soapbubble-filled" text="真的没有了~"></ux-text>
				</ux-row>
			</ux-placeholder>
		</ux-scroll>
	</ux-page>
</template>
<template>
	<ux-page :stack="showDoc">
		<ux-navbar :title="title" :bold="true">
			<template v-slot:right>
				<!-- #ifndef MP -->
				<ux-button theme="text" icon="/static/tip.png" :icon-size="22" @click="onDoc()"></ux-button>
				<!-- #endif -->
			</template>
		</ux-navbar>
		
		<ux-scroll>
			<ux-card direction="column" icon="flag-filled" title="布局" :bold="true">
				<ux-text text="支持配置分栏间隔、分栏偏移、对齐方式"></ux-text>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="栅格" :bold="true">
				<ux-text text="共有12栅格,任意分配,只有 flex=false 时才能开启分栏" :mb="15"></ux-text>
				<ux-col>
					<ux-row>
						<ux-col :flex="false" :span="2">
							<view class="cell bg">
								<ux-text text="2"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="10">
							<view class="cell bg-dark">
								<ux-text text="10"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row :mt="10">
						<ux-col :flex="false" :span="4">
							<view class="cell bg">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="4">
							<view class="cell bg-dark">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="4">
							<view class="cell bg-light">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="分栏间隔" :bold="true">
				<ux-text text="支持配置分栏间隔" :mb="15"></ux-text>
				<ux-col>
					<ux-row justify="between" :gutter="10">
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg-light">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :gutter="10">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row :gutter="10" :mt="10">
						<ux-col :flex="false" :span="2" :gutter="10">
							<view class="cell bg">
								<ux-text text="2"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="4" :gutter="10">
							<view class="cell bg-dark">
								<ux-text text="4"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="6" :gutter="10">
							<view class="cell bg-light">
								<ux-text text="6"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="分栏偏移" :bold="true">
				<ux-text text="支持设置分栏偏移量" :mb="15"></ux-text>
				<ux-col>
					<ux-row justify="between" :mt="10">
						<ux-col :flex="false" :span="3" :offset="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3" :offset="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="对齐" :bold="true">
				<ux-text text="支持 justify 和 align 对齐方式" :mb="15"></ux-text>
				<ux-col>
					<ux-row justify="between" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row justify="around" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row justify="left" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
					
					<ux-row justify="right" :mt="10">
						<ux-col :flex="false" :span="3">
							<view class="cell bg">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
						<ux-col :flex="false" :span="3">
							<view class="cell bg-dark">
								<ux-text text="3"></ux-text>
							</view>
						</ux-col>
					</ux-row>
				</ux-col>
			</ux-card>
			
			<ux-placeholder :height="200">
				<ux-row justify="center" align="center" style="height: 100%;">
					<ux-text prefix-icon="soapbubble-filled" text="真的没有了~"></ux-text>
				</ux-row>
			</ux-placeholder>
		</ux-scroll>
	</ux-page>
</template>
ts
<script setup>
	
	import * as plus from '@/uni_modules/ux-plus'
	
	const title = ref('')
	
	onLoad((e) => {
		title.value = e['title'] ?? ''
	})
	
	const showDoc = ref(false)
	
	function onDoc() {
		plus.openWeb({
			title: '在线文档',
			url: 'https://www.uxframe.cn/component/layout.html',
			// blur: 1,
			success: () => {
				showDoc.value = true
			},
			complete: () => {
				showDoc.value = false
			}
		})
	}
</script>
<script setup>
	
	import * as plus from '@/uni_modules/ux-plus'
	
	const title = ref('')
	
	onLoad((e) => {
		title.value = e['title'] ?? ''
	})
	
	const showDoc = ref(false)
	
	function onDoc() {
		plus.openWeb({
			title: '在线文档',
			url: 'https://www.uxframe.cn/component/layout.html',
			// blur: 1,
			success: () => {
				showDoc.value = true
			},
			complete: () => {
				showDoc.value = false
			}
		})
	}
</script>
css
<style lang="scss">
	
	.cell {
		height: 30px;
		border-radius: 6px;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}
	
	.bg {
	    background: #ced7e1;
	}
	
	.bg-light {
	    background: #e5e9f2;
	}
	
	.bg-dark {
	    background: #99a9bf;
	}
	
</style>
<style lang="scss">
	
	.cell {
		height: 30px;
		border-radius: 6px;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}
	
	.bg {
	    background: #ced7e1;
	}
	
	.bg-light {
	    background: #e5e9f2;
	}
	
	.bg-dark {
	    background: #99a9bf;
	}
	
</style>