npm下载
npm install --save emoji-mart-vue
template 应用
import { Picker } from "emoji-mart-vue"; //引入组件
components: { //注册组件,不能全局挂载
Picker
}
直接丢在输入框上边就行
<picker :include="['people','Smileys']" :showSearch="false" :showPreview="false" :showCategories="false" @select="addEmoji" />
输入框的变量 + 表情包文字
addEmoji(e){
this.content += e.native;
},
最后是 css 消除文字
.emoji-mart[data-v-7bc71df8] {
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
display: -ms-flexbox;
display: flex;
-ms-flex-direction: column;
flex-direction: column;
height: 420px;
color: #ffffff !important;
border: 1px solid #d9d9d9;
border-radius: 5px;
background: #fff;
}
效果图
转载作品,原作者:,文章来源:https://www.cnblogs.com/majiayin/p/15797456.html