vue表情包公共组件(适用于聊天室)

组件内容

<template>
  <div class="emoji-Bigbox">
    <el-scrollbar ref="emojiScroll" class="emojiScroll">
      <div
        class="emoji-box"
        v-for="(item, index) in emoji_icon"
        :key="index"
        @click="pickEmoji(index)"
      >
        {{ item }}
      </div>
    </el-scrollbar>
  </div>
</template>
<script>
export default {
  data() {
    return {
      emoji_icon: [
        "😀",
        "😃",
        "😄",
        "😁",
        "😆",
        "😅",
        "🤣",
        "😂",
        "🙂",
        "🙃",
        "😉",
        "😊",
        "😇",
        "😍",
        "🤩",
        "😘",
        "😗",
        "😚",
        "😙",
        "😋",
        "😛",
        "😜",
        "🤪",
        "😝",
        "🤑",
        "🤗",
        "🤭",
        "🤫",
        "🤔",
        "🤐",
        "🤨",
        "😐",
        "😑",
        "😶",
        "😏",
        "😒",
        "🙄",
        "😬",
        "🤥",
        "😌",
        "😔",
        "😪",
        "🤤",
        "😴",
        "😷",
        "🤒",
        "🤕",
        "🤢",
        "🤮",
        "🤧",
        "😵",
        "🤯",
        "🤠",
        "😎",
        "🤓",
        "🧐",
        "😕",
        "😟",
        "🙁",
        "😮",
        "😯",
        "😲",
        "😳",
        "😦",
        "😧",
        "😨",
        "😰",
        "😥",
        "😢",
        "😭",
        "😱",
        "😖",
        "😣",
        "😞",
        "😓",
        "😩",
        "😫",
        "😤",
        "😡",
        "😠",
        "🤬",
        "😈",
        "👿",
        "💀",
        "💩",
        "🤡",
        "👹",
        "👺",
        "👻",
        "👽",
        "👾",
        "🤖",
        "😺",
        "😸",
        "😹",
        "😻",
        "😼",
        "😽",
        "🙀",
        "😿",
        "😾",
        "💋",
        "👋",
        "🤚",
        "🖐",
        "✋",
        "🖖",
        "👌",
        "🤞",
        "🤟",
        "🤘",
        "🤙",
        "👈",
        "👉",
        "👆",
        "🖕",
        "👇",
        "👍",
        "👎",
        "✊",
        "👊",
        "🤛",
        "🤜",
        "👏",
        "🙌",
        "👐",
        "🤲",
        "🤝",
        "🙏",
        "💅",
        "🤳",
        "💪",
        "👂",
        "👃",
        "🧠",
        "👀",
        "👁",
        "👅",
        "👄",
        "👶",
        "🧒",
        "👦",
        "👧",
        "🧑",
        "👱",
        "👨",
        "🧔",
        "👱‍",
        "👨‍",
        "👨‍",
        "👨‍",
        "👨‍",
        "👩",
        "👱‍",
        "👩‍",
        "👩‍",
        "👩‍",
        "👩‍",
        "🧓",
        "👴",
        "👵",
        "🙍",
        "🙍‍",
        "🙍‍",
        "🙎",
        "🙎‍",
        "🙎‍",
        "🙅",
        "🙅‍",
        "🙅‍",
        "🙆",
        "🙆‍",
        "🙆‍",
        "💁",
        "💁‍",
        "💁‍",
        "🙋",
        "🙋‍",
        "🙋‍",
        "🙇",
        "🙇‍",
        "🙇‍",
        "🤦",
        "🤦‍",
        "🤦‍",
        "🤷",
        "🤷‍",
        "🤷‍",
        "👨‍⚕️",
        "👩‍⚕️",
        "👨‍🎓",
        "👩‍🎓",
        "👨‍🏫",
        "👩‍🏫",
        "👨‍⚖️",
        "👩‍⚖️",
        "👨‍🌾",
        "👩‍🌾",
        "👨‍🍳",
        "👩‍🍳",
        "👨‍🔧",
        "👩‍🔧",
        "👨‍🏭",
        "👩‍🏭",
        "👨‍💼",
        "👩‍💼",
        "👨‍🔬",
        "👩‍🔬",
        "👨‍💻",
        "👩‍💻",
        "👨‍🎤",
        "👩‍🎤",
        "👨‍🎨",
        "👩‍🎨",
        "👨‍✈️",
        "👩‍✈️",
        "👨‍🚀",
        "👩‍🚀",
        "👨‍🚒",
        "👩‍🚒",
        "👮",
        "👮‍♂️",
        "👮‍♀️",
        "🕵",
        "🕵️‍♂️",
        "🕵️‍♀️",
        "💂",
        "💂‍",
        "💂‍",
        "👷",
        "👷‍",
        "👷‍",
        "🤴",
        "👸",
        "👳",
        "👳‍",
        "👳‍",
        "👲",
        "🧕",
        "🤵",
        "👰",
        "🤰",
        "🤱",
        "👼",
        "🎅",
        "🤶",
        "🧙",
        "🧙‍",
        "🧙‍",
        "🧚",
        "🧚‍",
        "🧚‍",
        "🧛",
        "🧛‍",
        "🧛‍",
        "🧜",
        "🧜‍",
        "🧜‍",
        "🧝",
        "🧝‍",
        "🧝‍",
        "🧞",
        "🧞‍",
        "🧞‍",
        "🧟",
        "🧟‍",
        "🧟‍",
        "💆",
        "💆‍",
        "💆‍",
        "💇",
        "💇‍",
        "💇‍",
        "🚶",
        "🚶‍",
        "🚶‍",
        "🏃",
        "🏃‍",
        "🏃‍",
        "💃",
        "🕺",
        "🕴",
        "👯",
        "👯‍",
        "👯‍",
        "🧖",
        "🧖‍",
        "🧖‍",
        "🧘",
        "👭",
        "👫",
        "👬",
        "💏",
        "👨‍",
        "👩‍",
        "💑",
        "👨‍",
        "👩‍",
        "👪",
        "👨‍👩‍👦",
        "👨‍👩‍👧",
        "👨‍👩‍👧‍👦",
        "👨‍👩‍👦‍👦",
        "👨‍👩‍👧‍👧",
        "👨‍👨‍👦",
        "👨‍👨‍👧",
        "👨‍👨‍👧‍👦",
        "👨‍👨‍👦‍👦",
        "👨‍👨‍👧‍👧",
        "👩‍👩‍👦",
        "👩‍👩‍👧",
        "👩‍👩‍👧‍👦",
        "👩‍👩‍👦‍👦",
        "👩‍👩‍👧‍👧",
        "👨‍👦",
        "👨‍👦‍👦",
        "👨‍👧",
        "👨‍👧‍👦",
        "👨‍👧‍👧",
        "👩‍👦",
        "👩‍👦‍👦",
        "👩‍👧",
        "👩‍👧‍👦",
        "👩‍👧‍👧",
        "🗣",
        "👤",
        "👥",
        "👣",
        "🌂",
        "☂",
        "👓",
        "🕶",
        "👔",
        "👕",
        "👖",
        "🧣",
        "🧤",
        "🧥",
        "🧦",
        "👗",
        "👘",
        "👙",
        "👚",
        "👛",
        "👜",
        "👝",
        "🎒",
        "👞",
        "👟",
        "👠",
        "👡",
        "👢",
        "👑",
        "👒",
        "🎩",
        "🎓",
        "🧢",
        "⛑",
        "💄",
        "💍",
        "💼"
      ]
    }
  },
  methods: {
    pickEmoji(idx) {
      return this.$emit("selectEmoji", this.emoji_icon[idx])
    },
  }
}
</script>
<style lang="scss" scoped>

.emoji-Bigbox {
  height: 300px;
  background: #fff;
  border-radius: 10px;
  // display: flex;
  // flex-direction: row;
  // flex-wrap: wrap;
  // overflow-y: scroll;
  .el-scrollbar {
    .el-scrollbar__wrap /deep/{
      overflow-y: hidden !important;
    }
  }
  .emojiScroll{
    height: 310px;
  }
  .emoji-box {
    display: inline-block;
    width: 30px;
    height: 30px;
    font-size: 22px;
    // border: 1px solid red;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    // &:hover {
    //   border-radius: 5px;
    //   // background: rgba(160, 158, 158, 0.39);
    //   transform: scale(1.5);
    // }
  }
}
</style>

调用(引入方式忽略)

 <Popover
     ref="popover5"
     placement="top-start"
     width="360"
     v-model="chatPopover"
   >
     <p>
       <ChatEmoji
         v-on:selectEmoji="selectEmoji"
         :inpMessage="message"
       />
     </p>
   </Popover>
   <div
     v-popover:popover5
     class="chatRoom_input_emoji"
     @click="showEmojiHandle"
   >
     <img src="此处微表情图标" />
   </div>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值