Skip to content
本页导读

Cell

组件类型:UxCellComponentPublicInstance

支持配置标题、描述文本、内容及样式,左右图标、插槽,最小高度、固定高度,对齐方式

平台兼容性

UniApp X

AndroidiOSweb鸿蒙 Next小程序
x

UniApp Vue Nvue

AndroidiOSweb鸿蒙 Next小程序
xxxx

Props

属性名类型默认值说明
leftSlot左边插槽
rightSlot右边插槽
titleString标题
sizeAny14标题大小
colorString$ux.Conf.fontColor标题颜色
darkColorString深色none-不显示,auto-自动适配深色模式,其他-颜色
boldBooleanfalse标题加粗
titleStyleString标题样式
summaryString描述文本
summaryColorString$ux.Conf.subtitleColor描述文本颜色
summarySizeAny$ux.Conf.fontSize.small描述文本大小
summaryStyleString描述文本样式
labelString右侧内容
labelSizeAny$ux.Conf.fontSize内容大小
labelColorString$ux.Conf.subtitleColor内容颜色
labelBoldBooleanfalse内容加粗
labelStyleString内容样式
placeholderString右侧占位内容
placeholderSizeAny$ux.Conf.fontSize.small右侧占位内容大小
placeholderColorString$ux.Conf.placeholderColor右侧占位内容颜色
placeholderDarkString深色none-不显示,auto-自动适配深色模式,其他-颜色
placeholderStyleString内容样式
iconString标题图标
iconColorString$ux.Conf.fontColor标题图标颜色
iconSizeAny$ux.Conf.fontSize标题图标大小
iconStyleString标题图标样式
rightIconString右侧图标
rightArrowBooleantrue右侧箭头图标
rightIconStyleString右侧图标样式
customFontString自定义字体路径
customFamilyString字体family
backgroundString背景色
backgroundDarkStringauto深色none-不显示,auto-自动适配深色模式,其他-颜色
borderBooleantrue显示下边框
borderColorString$ux.Conf.borderColor下边框颜色
borderDarkColorStringauto深色none-不显示,auto-自动适配深色模式,其他-颜色
minHeightAny0最小高度
heightAny40固定高度优先级高于最小高度
paddingAny$ux.Conf.rowPadding内部水平边距
centerBooleanfalse内容是否垂直居中
requiredBooleanfalse是否显示必填星号
pathString页面跳转路径
showStringtrue是否显示cell
disabledBooleanfalse是否禁用cell
hoverBooleantrue显示点击态
marginArray边距[上右下左][上下左右][上下左右]
mtAny距上单位px
mrAny距右单位px
mbAny距下单位px
mlAny距左单位px
xstyleArray自定义样式

darkColor

说明
none不显示
auto自动适配深色模式
color其他颜色

placeholderDark

说明
none不显示
auto自动适配深色模式
color其他颜色

backgroundDark

说明
none不显示
auto自动适配深色模式
color其他颜色

borderDarkColor

说明
none不显示
auto自动适配深色模式
color其他颜色

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="支持配置标题、描述文本、内容及样式" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="UxFrmae" label="ui 框架" :required="true"></ux-cell>
					<ux-cell title="让UniX开发更简单" summary="高性能UI框架" label="Lets Go" :right-arrow="false" :height="60"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="左右图标" :bold="true">
				<ux-text text="左右图标支持icon和图片" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="图标" icon="signature" color="blue" icon-color="blue"></ux-cell>
					<ux-cell title="照片" icon="/static/logo.png"></ux-cell>
					<ux-cell title="下箭头" right-icon="arrowdown" :border="false"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="高度" :bold="true">
				<ux-text text="支持配置最小高度和固定高度" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="最小高度" :right-arrow="true" :min-height="30"></ux-cell>
					<ux-cell title="固定高度" :right-arrow="true" :height="80"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="内容居中" :bold="true">
				<ux-text text="支持标题居中显示" :mb="15"></ux-text>
				<ux-col>
					<ux-cell icon="setoff-filled" icon-color="red" title="退出账号" color="red" :center="true" :border="false" :right-arrow="false"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="左右边距" :bold="true">
				<ux-text text="支持配置左右边距" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="左右0边距"></ux-cell>
					<ux-cell title="左右30边距" :padding="30"></ux-cell>
					<ux-cell title="默认边距" :border="false"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="自定义插槽" :bold="true">
				<ux-text text="支持左右插槽、summary插槽" :mb="15"></ux-text>
				<ux-col>
					<ux-cell label="左侧插槽">
						<template v-slot:left>
							<ux-image :width="25" mode="widthFix" src="/static/logo.png"></ux-image>
						</template>
					</ux-cell>
					<ux-cell title="右侧插槽">
						<template v-slot:right>
							<ux-row justify="right">
								<ux-badge :value="88" :fixed="false" :right="10"></ux-badge>
								<ux-icon type="scan-outline"></ux-icon>
							</ux-row>
						</template>
					</ux-cell>
					<ux-cell title="summary插槽">
						<template v-slot:summary>
							<ux-text text="我是插槽" theme="success"></ux-text>
						</template>
					</ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="跳转页面" :bold="true">
				<ux-text text="支持点击直接跳转页面" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="跳转到Button" path="/pages/component/button?title=From Cell单元格" :border="false"></ux-cell>
				</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="支持配置标题、描述文本、内容及样式" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="UxFrmae" label="ui 框架" :required="true"></ux-cell>
					<ux-cell title="让UniX开发更简单" summary="高性能UI框架" label="Lets Go" :right-arrow="false" :height="60"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="左右图标" :bold="true">
				<ux-text text="左右图标支持icon和图片" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="图标" icon="signature" color="blue" icon-color="blue"></ux-cell>
					<ux-cell title="照片" icon="/static/logo.png"></ux-cell>
					<ux-cell title="下箭头" right-icon="arrowdown" :border="false"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="高度" :bold="true">
				<ux-text text="支持配置最小高度和固定高度" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="最小高度" :right-arrow="true" :min-height="30"></ux-cell>
					<ux-cell title="固定高度" :right-arrow="true" :height="80"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="内容居中" :bold="true">
				<ux-text text="支持标题居中显示" :mb="15"></ux-text>
				<ux-col>
					<ux-cell icon="setoff-filled" icon-color="red" title="退出账号" color="red" :center="true" :border="false" :right-arrow="false"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="左右边距" :bold="true">
				<ux-text text="支持配置左右边距" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="左右0边距"></ux-cell>
					<ux-cell title="左右30边距" :padding="30"></ux-cell>
					<ux-cell title="默认边距" :border="false"></ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="自定义插槽" :bold="true">
				<ux-text text="支持左右插槽、summary插槽" :mb="15"></ux-text>
				<ux-col>
					<ux-cell label="左侧插槽">
						<template v-slot:left>
							<ux-image :width="25" mode="widthFix" src="/static/logo.png"></ux-image>
						</template>
					</ux-cell>
					<ux-cell title="右侧插槽">
						<template v-slot:right>
							<ux-row justify="right">
								<ux-badge :value="88" :fixed="false" :right="10"></ux-badge>
								<ux-icon type="scan-outline"></ux-icon>
							</ux-row>
						</template>
					</ux-cell>
					<ux-cell title="summary插槽">
						<template v-slot:summary>
							<ux-text text="我是插槽" theme="success"></ux-text>
						</template>
					</ux-cell>
				</ux-col>
			</ux-card>
			
			<ux-card direction="column" icon="arrowright" title="跳转页面" :bold="true">
				<ux-text text="支持点击直接跳转页面" :mb="15"></ux-text>
				<ux-col>
					<ux-cell title="跳转到Button" path="/pages/component/button?title=From Cell单元格" :border="false"></ux-cell>
				</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'
	import { useBackgroundColor } from '@/uni_modules/ux-frame'

	const title = ref('')
	
	const backgroundColor = computed((): string => {
		return useBackgroundColor('#f0f0f0', '#555555')
	})
	
	const style = computed((): string => {
		return `background-color: ${backgroundColor.value}`
	})
	
	const showDoc = ref(false)
	
	function onDoc() {
		plus.openWeb({
			title: '在线文档',
			url: 'https://www.uxframe.cn/component/cell.html',
			// blur: 1,
			success: () => {
				showDoc.value = true
			},
			complete: () => {
				showDoc.value = false
			}
		})
	}
	
	onLoad((e) => {
		title.value = e['title'] ?? ''
	})
</script>
<script setup>
	import * as plus from '@/uni_modules/ux-plus'
	import { useBackgroundColor } from '@/uni_modules/ux-frame'

	const title = ref('')
	
	const backgroundColor = computed((): string => {
		return useBackgroundColor('#f0f0f0', '#555555')
	})
	
	const style = computed((): string => {
		return `background-color: ${backgroundColor.value}`
	})
	
	const showDoc = ref(false)
	
	function onDoc() {
		plus.openWeb({
			title: '在线文档',
			url: 'https://www.uxframe.cn/component/cell.html',
			// blur: 1,
			success: () => {
				showDoc.value = true
			},
			complete: () => {
				showDoc.value = false
			}
		})
	}
	
	onLoad((e) => {
		title.value = e['title'] ?? ''
	})
</script>
css
<style lang="scss">
	.title {
		width: 100%;
		height: 80rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
	}
</style>
<style lang="scss">
	.title {
		width: 100%;
		height: 80rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
	}
</style>