uni-app实现emoj表情包发送(nvue版)

uni-app实现表情包发送, vue实现思路直接使用grideview网格布局加载emoj表情包即可实现,很简单,但是nvue稍微复杂,这里采用的方案是nvue提供的组件list

看效果

代码

复制代码
<template>
	<view style="margin-right: 10rpx;margin-left: 20rpx;height: 446rpx;">
		<!--列表-->
		<list :show-scrollbar='false'>
			<!-- 注意事项: 不能使用 index 作为 key 的唯一标识 -->
			<cell v-for="(items, index) in emojData" :key="items.id">
				<view style="display: flex;flex-direction: row;">
					<block v-for="(item, index) in items">
						<view class="emoj_parent" hover-class="checkActive" hover-stay-time="100"
							@click="tuchEmoj(item,index)">
							<text @click="tuchEmoj(item,index)" class="emoj_conn">{{item}}</text>
						</view>
					</block>
				</view>

			</cell>
		</list>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				emojData: [
					['🤞', '👍', '👏', '❤', '😁', '🖐', '😀', '😃'],
					['😄', '😁', '😆', '😅', '😂', '🤣', '😊', '😇'],
					['🙂', '🙃', '😉', '😌', '😍', '🥰', '😘', '😗'],
					['😙', '😚', '😋', '😛', '😝', '😜', '🤪', '🤨'],
					['🧐', '🤓', '😎', '🤩', '🥳', '😏', '😒', '😞'],
					['😔', '😟', '😕', '🙁', '😣', '😖', '😫', '😩'],
					['🥺', '😢', '😭', '😤', '😠', '😡', '🤬', '🤯'],
					['😳', '🥵', '🥶', '😱', '😨', '😰', '😥', '😓'],
					['🤗', '🤔', '🤭', '🤫', '🤥', '😶', '😐', '😑'],
					['😬', '🙄', '😯', '😦', '😧', '😮', '😲', '😴'],
					['🤤', '😪', '😵', '🤐', '🥴', '🤢', '🤮', '🤧'],
					['😷', '🤒', '🤕', '🤑', '🤠', '👻', '🐧']
				]
			}
		},
		methods: {
			tuchEmoj: function(item, index) {
				console.log("====tuchEmoj====" + JSON.stringify(index) + "===" + item)
			}
		}
	}
</script>

<style>
	.emoj_parent {
		margin-left: 8rpx;
		margin-bottom: 5rpx;
		align-items: center;
		margin-top: 8rpx;
		padding-top: 5rpx;
		padding-bottom: 5rpx;
	}

	.checkActive {
		background-color: #e8e8e8 !important;
	}

	.emoj_conn {
		width: 80rpx;
		font-size: 56rpx;
		text-align: center;
	}
</style>
相关推荐
Profile排查笔记2 小时前
指纹浏览器环境异常排查:Fingerprint、Profile、Proxy、Session 和 Task Log 怎么看
前端·人工智能·后端·自动化
京韵养生记2 小时前
【无标题】
java·服务器·前端
格子软件2 小时前
2026年分布式GEO代理流量调度:源码级状态机防重挂实战
java·vue.js·人工智能·spring boot·分布式·vue
大气的小蜜蜂2 小时前
领域层的服务
java·前端·数据库
星栈2 小时前
LiveView 的 LiveComponent:比 React 组件更轻,但我一开始真的把它用错了
前端·前端框架·elixir
林希_Rachel_傻希希2 小时前
web性能优化之延迟加载图片和<inframe>
前端·javascript·面试
maxmaxma3 小时前
Konva 从入门到实践 - day1
前端
火星校尉3 小时前
一场数据基建与消费场景的跨界实验
java·前端·数据库·python·php
W是笔名3 小时前
python_let`s try it 6___BMI计算器
java·前端·python
risc1234563 小时前
Lucene80DocValuesConsumer 五种类型源码阅读顺序
java·服务器·前端