emotion.vue 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <view class="emotion" @click="$emit('emotion','')">
  3. <scroll-view class="scroll-box" scroll-y="true" height="400">
  4. <view class="emotion-item-list">
  5. <view class="emotion-item" v-for="(emoText, i) in $emo.emoTextList" :key="i" @click="selectEmo(emoText)" v-html="$emo.textToImg(emoText)">
  6. </view>
  7. </view>
  8. </scroll-view>
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. name: "emotion",
  14. data() {
  15. return {}
  16. },
  17. methods: {
  18. selectEmo(emoText) {
  19. let emotion = `#${emoText};`
  20. this.$emit('emotion', emotion)
  21. }
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. .emotion {
  27. .scroll-box{
  28. height: 400rpx;
  29. .emotion-item-list {
  30. display: flex;
  31. flex-wrap: wrap;
  32. .emotion-item {
  33. width: 40px;
  34. height: 40px;
  35. text-align: center;
  36. cursor: pointer;
  37. }
  38. }
  39. }
  40. }
  41. </style>