# tui-list-cell 列表Item
介绍
可设置点击效果,设置是否显示箭头,也可以搭配 tui-list-view
使用,tui-list-view
可以为 tui-list-cell
提供上下外边框。
# 引入
# uni-app引入
第一种,手动引入(可全局引入)
import tuiListCell from "@/components/thorui/tui-list-cell/tui-list-cell.vue"
export default {
components:{
tuiListCell
}
}
第二种,开启easycom组件模式,如果不了解如何配置,可先查看 官网文档 (opens new window)。
# uni-app版本平台差异说明
App-Nvue | App-vue | H5 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|---|
升级中 | √ | √ | √ | √ | √ | √ | √ |
# 微信小程序引入(可在app.json中全局引入)
{
"usingComponents": {
"tui-list-cell": "/components/thorui/tui-list-cell/tui-list-cell"
}
}
# 代码演示
部分功能演示,具体可参考示例程序以及文档API。
不带箭头,无点击效果头
通过 hover
属性设置点击效果,arrow
属性设置是否显示箭头。
<!--uni-app-->
<tui-list-view title="不带箭头,无点击效果" color="#777">
<tui-list-cell :hover="false" :arrow="false">
不带箭头,无点击效果
</tui-list-cell>
</tui-list-view>
<!--微信小程序 (arrow默认值为false,可不设置)-->
<tui-list-view title="不带箭头,无点击效果" color="#777">
<tui-list-cell hover="{{false}}">
不带箭头,无点击效果
</tui-list-cell>
</tui-list-view>
带箭头,有点击效果
通过 hover
属性设置点击效果,arrow
属性设置是否显示箭头。
<!--hover 默认为true,所以不需要设置-->
<tui-list-view title="带箭头,有点击效果" color="#777">
<tui-list-cell arrow>
带箭头,有点击效果
</tui-list-cell>
</tui-list-view>
# Slots
名称 | 说明 |
---|---|
default | 标签显示内容,按需插入自定义内容 |
# Props
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
arrow | Boolean | 是否显示右箭头 | false |
arrowColor | String | 箭头颜色,可传值: white,gray,warning,danger,success | - |
hover | Boolean | 是否有点击效果 | true |
unlined | Boolean | 隐藏线条 | false |
lineLeft | Boolean | 线条是否有左偏移距离 | true |
lineRight | Boolean | 线条是否有右偏移距离 | false |
padding | String | 内边距 | 26rpx 30rpx |
backgroundColor | String | 背景颜色 | #fff |
size | Number | 字体大小 | 28 |
color | String | 字体颜色 | #333 |
radius | Boolean | 是否加圆角 | false |
arrowRight | Boolean | 箭头是否有偏移距离 | true |
index | Number | 索引 | 0 |
# Events
事件名 | 说明 | 回调参数 |
---|---|---|
click | 点击事件,点击标签时触发 | {index: Number} |
# 预览
# 线上程序扫码预览
![]() | ![]() | ![]() |
---|---|---|
ThorUI组件库小程序码 | H5二维码 | ThorUI示例小程序码 |