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>
相关推荐
Csvn5 小时前
WASM
前端
修己xj6 小时前
我用 AI 给自己写了一个 Markdown 编辑器,然后把它开源了
前端
FRing036 小时前
vue2干货总结2(v-bind、v-for、v-model、指令修饰符、v-bind操作class和style)
开发语言·前端·vue.js·vue2
幸运小猿7 小时前
模拟慢上传-处理超时重试image 丢失线上问题
前端·javascript·html
moshuying8 小时前
网购能买Token了!
前端
h_65432108 小时前
echarts实现柱状图加一条横线
前端·echarts
风骏时光牛马9 小时前
生成一个后端标题,只需要一个标题,不需要其他的任何文本。
前端
子非鱼@Itfuture9 小时前
关于前后端联调中登录状态/登录信息失效?
java·前端
郭小李9 小时前
openFeign入门
java·开发语言·前端
馒头不想说话9 小时前
AI当运营,帮你省人力
前端