You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< template >
< view class = "u-cell-box" >
< 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>
/**
* cellGroup 单元格父组件Group
* @description cell单元格一般用于一组列表的情况, 比如个人中心页, 设置页等。搭配u-cell-item
* @tutorial https://www.uviewui.com/components/cell.html
* @property {String} title 分组标题
* @property {Boolean} border 是否显示外边框( 默认true)
* @property {Object} title-style 分组标题的的样式,对象形式,如{'font-size': '24rpx'} 或 {'fontSize': '24rpx'}
* @example <u-cell-group title="设置喜好" >
* /
export default {
name : " u -cell -group " ,
props : {
/ / 分 组 标 题
title : {
type : String ,
default : ' '
} ,
/ / 是 否 显 示 分 组 list 上 下 边 框
border : {
type : Boolean ,
default : true
} ,
/ / 分 组 标 题 的 样 式 , 对 象 形 式 , 注 意 驼 峰 属 性 写 法
/ / 类 似 { ' font -size ' : ' 24rpx ' } 和 { ' fontSize ' : ' 24rpx ' }
titleStyle : {
type : Object ,
default ( ) {
return {} ;
}
}
} ,
data ( ) {
return {
index : 0 ,
}
} ,
}
< / script >
< style lang = "scss" scoped >
@ import "../../libs/css/style.components.scss" ;
. u - cell - box {
width : 100 % ;
}
. u - cell - title {
padding : 30 rpx 32 rpx 10 rpx 32 rpx ;
font - size : 30 rpx ;
text - align : left ;
color : $u - tips - color ;
}
. u - cell - item - box {
background - color : # FFFFFF ;
flex - direction : row ;
}
< / style >