emoji.vue 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view
  3. class="chat-emoji"
  4. :class="[
  5. {
  6. 'is-show': visible
  7. }
  8. ]"
  9. >
  10. <scroll-view scroll-y class="scroller">
  11. <cl-row>
  12. <cl-col :span="4" v-for="(item, index) in emoji" :key="index">
  13. <view class="block" @tap="select(item)">
  14. {{item}}
  15. </view>
  16. </cl-col>
  17. </cl-row>
  18. </scroll-view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. props: {
  24. visible: Boolean
  25. },
  26. data() {
  27. return {
  28. };
  29. },
  30. methods: {
  31. select(e) {
  32. this.$emit("select", e);
  33. }
  34. }
  35. };
  36. </script>
  37. <style lang="scss" scoped>
  38. .chat-emoji {
  39. height: 0;
  40. box-sizing: border-box;
  41. transition: height 0.3s;
  42. &.is-show {
  43. height: 400rpx;
  44. padding: 10rpx 0 0 0;
  45. }
  46. .scroller {
  47. height: 100%;
  48. .block {
  49. display: flex;
  50. justify-content: center;
  51. align-items: center;
  52. border-radius: 10rpx;
  53. height: 100rpx;
  54. &:active {
  55. background-color: #f7f7f7;
  56. }
  57. image {
  58. display: inline-block;
  59. height: 60rpx;
  60. width: 60rpx;
  61. }
  62. }
  63. }
  64. }
  65. </style>