This commit is contained in:
2026-03-25 14:54:15 +08:00
commit ab4646b43a
827 changed files with 123812 additions and 0 deletions
@@ -0,0 +1,19 @@
import type { ExtractPropTypes, PropType } from 'vue';
import { baseProps } from '../common/props';
/**
* cell-group 组件 props 类型定义
* @description 供 u-cell-group 组件 props 使用
*/
export const CellGroupProps = {
...baseProps,
/** 分组标题 */
title: { type: String, default: '' },
/** 是否显示分组list上下边框 */
border: { type: Boolean, default: true },
/** 分组标题的样式,对象形式,注意驼峰属性写法 */
titleStyle: { type: Object as PropType<Record<string, any>>, default: () => ({}) }
};
export type CellGroupProps = ExtractPropTypes<typeof CellGroupProps>;
@@ -0,0 +1,60 @@
<template>
<view class="u-cell-box" :class="customClass" :style="$u.toStyle(customStyle)">
<view class="u-cell-title" v-if="title" :style="[titleStyle]">
{{ title }}
</view>
<view class="u-cell-item-box" :class="{ 'u-border-bottom u-border-top': border }">
<slot />
</view>
</view>
</template>
<script lang="ts">
export default {
name: 'u-cell-group',
options: {
addGlobalClass: true,
// #ifndef MP-TOUTIAO
virtualHost: true,
// #endif
styleIsolation: 'shared'
}
};
</script>
<script setup lang="ts">
import { CellGroupProps } from './types';
import { $u } from '../..';
/**
* cellGroup 单元格父组件Group
* @description cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。搭配u-cell-item
* @tutorial https://uviewpro.cn/zh/components/cell.html
* @property {String} title 分组标题
* @property {Boolean} border 是否显示外边框(默认true)
* @property {Object} title-style 分组标题的的样式,对象形式,如{'font-size': '24rpx'} 或 {'fontSize': '24rpx'}
* @example <u-cell-group title="设置喜好">
*/
defineProps(CellGroupProps);
</script>
<style lang="scss" scoped>
@import '../../libs/css/style.components.scss';
.u-cell-box {
width: 100%;
}
.u-cell-title {
padding: 30rpx 32rpx 10rpx 32rpx;
font-size: 30rpx;
text-align: left;
color: $u-tips-color;
}
.u-cell-item-box {
background-color: var(--u-bg-white);
flex-direction: row;
}
</style>