frontend/examking-app/plugins/uview-ui/components/u-cell-item/u-cell-item.vue

(开头部分) 7KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<template>
	<view
		@tap="click"
		class="u-cell"
		:class="{ 'u-border-bottom': borderBottom, 'u-border-top': borderTop, 'u-col-center': center, 'u-cell--required': required }"
		hover-stay-time="150"
		:hover-class="hoverClass"
		:style="{
			backgroundColor: bgColor
		}"
	>
		<u-icon :size="iconSize" :name="icon" v-if="icon" :custom-style="iconStyle" class="u-cell__left-icon-wrap"></u-icon>
		<view class="u-flex" v-else>
			<slot name="icon"></slot>
		</view>
		<view
			class="u-cell_title"
			:style="[
				{
					width: titleWidth ? titleWidth + 'rpx' : 'auto'
				},
				titleStyle
			]"
		>
			<block v-if="title">{{ title }}</block>
			<slot name="title" v-else></slot>

			<view class="u-cell__label" v-if="label || $slots.label" :style="[labelStyle]">
				<block v-if="label">{{ label }}</block>
				<slot name="label" v-else></slot>
			</view>
		</view>

		<view class="u-cell__value" :style="[valueStyle]">
			<block class="u-cell__value" v-if="value">{{ value }}</block>
			<slot v-else></slot>
		</view>
		<view class="u-flex u-cell_right" v-if="$slots['right-icon']">
			<slot name="right-icon"></slot>
		</view>
		<u-icon v-if="arrow" name="arrow-right" :style="[arrowStyle]" class="u-icon-wrap u-cell__right-icon-wrap"></u-icon>
	</view>
</template>

<script>
/**
 * cellItem 单元格Item
 * @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。搭配u-cell-group使用
 * @tutorial https://www.uviewui.com/components/cell.html
 * @property {String} title 左侧标题
 * @property {String} icon 左侧图标名,只支持uView内置图标,见Icon 图标
 * @property {Object} icon-style 左边图标的样式,对象形式
 * @property {String} value 右侧内容
 * @property {String} label 标题下方的描述信息
 * @property {Boolean} border-bottom 是否显示cell的下边框(默认true)
 * @property {Boolean} border-top 是否显示cell的上边框(默认false)
 * @property {Boolean} center 是否使内容垂直居中(默认false)
 * @property {String} hover-class 是否开启点击反馈,none为无效果(默认true)
 * // @property {Boolean} border-gap border-bottom为true时,Cell列表中间的条目的下边框是否与左边有一个间隔(默认true)
 * @property {Boolean} arrow 是否显示右侧箭头(默认true)
后面还有 256 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。