uniapp 使用组件-uni-list聊天列表

目录

一、圆/方头像且显示分割线

二、带圆点

三、自定义右侧内容

四、带通知角标的单头像聊天列表



需要从uni-app插件市场中进行安装:

一、圆/方头像且显示分割线


	<uni-list :border="false">
		<uni-list-chat
			:avatar-circle="true"
			title="张三"
			avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
			note="圆头像且显示分割线.圆头像且显示分割线.圆头像且显示分割线.圆头像且显示分割线"
			time="2020.02.30 xxx"
			:clickable="false"
		/>
		<uni-list-chat
			title="张三"
			avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
			note="方头像且显示分割线.方头像且显示分割线.方头像且显示分割线.方头像且显示分割线"
			time="2020.02.30 xxx"
			:clickable="false"
		/>
	</uni-list>

二、带圆点

<uni-list :border="false">
			<uni-list-chat
				:avatar-circle="true"
				title="张三"
				avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
				note="圆头像,带圆点且不显示分割线.圆头像,带圆点且不显示分割线."
				time="2020.02.30 xxx"
				:clickable="false"
				badge-positon="left"
				badge-text="dot"
			/>
			<uni-list-chat
				:avatar-circle="true"
				title="张三"
				avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
				note="圆头像,带圆点且不显示分割线.圆头像,带圆点且不显示分割线."
				time="2020.02.30 xxx"
				:clickable="false"
				badge-positon="left"
				badge-text="dot"
				:badge-text="2"
			/>
		</uni-list>

三、自定义右侧内容

	<uni-list :border="false">
					<uni-list-chat title="张三"
						avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
                        ellipsis="1" 
						note="自定义右侧内容.自定义右侧内容.自定义右侧内容.自定义右侧内容">
						<view class="chat-custom-right">
							<text class="chat-custom-text">刚刚</text>
							<uni-icons type="star-filled" color="#999" size="18"></uni-icons>
						</view>
					</uni-list-chat>
				</uni-list>

四、带通知角标的单头像聊天列表

<template>
	<view>
		<uni-list-chat
			title="单头像"
			avatar="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png"
			note="带通知角标的单头像聊天列表.带通知角标的单头像聊天列表."
			time="2020.02.30 xxx"
            badge-positon="left"
			:badge-text="2"
			:clickable="true"
			@click="onClick"
		/>
	</view>
</template>
 
<script>
export default {
	components: {},
	data() {
		return {};
	},
	methods: {
		onClick() {
			uni.showToast({
				title: '列表被点击'
			});
		}
	}
};
</script>

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值