栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

vue界面发送表情的实现代码

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

vue界面发送表情的实现代码

完全照搬不一定能写出来 只是让看个思想




@import '../../assets/css/dialogue.css';

#emoji-list {
 height: 230px;
 background: #fff;
}
#emoji-list .cell {
 line-height: 13vh;
 border-right: 1rpx solid #ddd;
 border-bottom: 1rpx solid #ddd;
}
.flex-row {
 display: flex;
 flex-direction: row;
 justify-content: center;
 align-items: center;
}
.flex-column {
 display: flex;
 flex-direction: column;
 justify-content: center;
 align-items: stretch;
}
.flex-cell {
 flex: 1;
}
.cell img {
 width: 35px;
 height: 35px;
}

补充知识:vue+element-ui实现聊天表情包

我是用的本地json数据实现的,表情不是很多,首先创建个json文件,代码如下:

[{
  "codes": "1F600",
  "char": "",
  "name": "grinning face"
 },
 {
  "codes": "1F603",
  "char": "",
  "name": "grinning face with big eyes"
 },
 {
  "codes": "1F604",
  "char": "",
  "name": "grinning face with smiling eyes"
 },
 {
  "codes": "1F601",
  "char": "",
  "name": "beaming face with smiling eyes"
 },
 {
  "codes": "1F606",
  "char": "",
  "name": "grinning squinting face"
 },
 {
  "codes": "1F605",
  "char": "",
  "name": "grinning face with sweat"
 },
 {
  "codes": "1F923",
  "char": "藍",
  "name": "rolling on the floor laughing"
 },
 {
  "codes": "1F602",
  "char": "",
  "name": "face with tears of joy"
 },
 {
  "codes": "1F642",
  "char": "",
  "name": "slightly smiling face"
 },
 {
  "codes": "1F643",
  "char": "",
  "name": "upside-down face"
 },
 {
  "codes": "1F609",
  "char": "",
  "name": "winking face"
 },
 {
  "codes": "1F60A",
  "char": "",
  "name": "smiling face with smiling eyes"
 },
 {
  "codes": "1F607",
  "char": "",
  "name": "smiling face with halo"
 },
 {
  "codes": "1F970",
  "char": "殺",
  "name": "smiling face with hearts"
 },
 {
  "codes": "1F60D",
  "char": "",
  "name": "smiling face with heart-eyes"
 },
 {
  "codes": "1F929",
  "char": "朗",
  "name": "star-struck"
 },
 {
  "codes": "1F618",
  "char": "",
  "name": "face blowing a kiss"
 },
 {
  "codes": "1F617",
  "char": "",
  "name": "kissing face"
 },
 {
  "codes": "1F61A",
  "char": "",
  "name": "kissing face with closed eyes"
 },
 {
  "codes": "1F619",
  "char": "",
  "name": "kissing face with smiling eyes"
 },
 {
  "codes": "1F44B",
  "char": "",
  "name": "waving hand"
 },
 {
  "codes": "1F91A",
  "char": "駱",
  "name": "raised back of hand"
 },
 {
  "codes": "1F590",
  "char": "",
  "name": "hand with fingers splayed"
 },
 {
  "codes": "270B",
  "char": "✋",
  "name": "raised hand"
 },
 {
  "codes": "1F596",
  "char": "",
  "name": "vulcan salute"
 },
 {
  "codes": "1F44C",
  "char": "",
  "name": "OK hand"
 },
 {
  "codes": "1F90F",
  "char": "羅",
  "name": "pinching hand"
 },
 {
  "codes": "270C",
  "char": "✌",
  "name": "victory hand"
 },
 {
  "codes": "1F91E",
  "char": "爛",
  "name": "crossed fingers"
 },
 {
  "codes": "1F91F",
  "char": "蘭",
  "name": "love-you gesture"
 },
 {
  "codes": "1F918",
  "char": "落",
  "name": "sign of the horns"
 },
 {
  "codes": "1F919",
  "char": "酪",
  "name": "call me hand"
 },
 {
  "codes": "1F448",
  "char": "",
  "name": "backhand index pointing left"
 },
 {
  "codes": "1F449",
  "char": "",
  "name": "backhand index pointing right"
 },
 {
  "codes": "1F446",
  "char": "",
  "name": "backhand index pointing up"
 },
 {
  "codes": "1F595",
  "char": "",
  "name": "middle finger"
 },
 {
  "codes": "1F447",
  "char": "",
  "name": "backhand index pointing down"
 },
 {
  "codes": "261D FE0F",
  "char": "☝️",
  "name": "index pointing up"
 },
 {
  "codes": "1F44D",
  "char": "",
  "name": "thumbs up"
 },
 {
  "codes": "1F44E",
  "char": "",
  "name": "thumbs down"
 },
 {
  "codes": "270A",
  "char": "✊",
  "name": "raised fist"
 },
 {
  "codes": "1F44A",
  "char": "",
  "name": "oncoming fist"
 },
 {
  "codes": "1F91B",
  "char": "亂",
  "name": "left-facing fist"
 },
 {
  "codes": "1F91C",
  "char": "卵",
  "name": "right-facing fist"
 }

]

vue组件中代码直接贴出来,废话不多说:







.el-popover {
 height: 200px;
 width: 400px;
 overflow: scroll;
 overflow-x: auto;
}



.chatIcon {
 padding: 0 10px;
 font-size: 25px;
}
.emotionList {
 display: flex;
 flex-wrap: wrap;
 padding: 5px;
}
.emotionItem {
 width: 10%;
 font-size: 20px;
 text-align: center;
}

.emotionItem {
 text-decoration: none;
}

.emotionItem:link {
 text-decoration: none;
}

.emotionItem:visited {
 text-decoration: none;
}

.emotionItem:hover {
 text-decoration: none;
}

.emotionItem:active {
 text-decoration: none;
}

以上这篇vue界面发送表情的实现代码就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持考高分网。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/68652.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号