HistoryLoadMore.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div :class="item_klass" @click="handleClick">
  3. <div class="history-item-icon can-loadmore" v-if="can_loadmore">{{ $t('conversation.history_loadmore') }}</div>
  4. <!-- <div class="history-item-icon" v-if="!can_loadmore">{{ $t('conversation.history_nomore') }}</div> -->
  5. </div>
  6. </template>
  7. <script setup>
  8. import { computed } from 'vue';
  9. const props = defineProps({
  10. can_loadmore: Boolean
  11. });
  12. const emit = defineEmits(['loadmore']);
  13. const item_klass = computed(() => {
  14. const obj = {
  15. 'conversation-history-item': true
  16. };
  17. obj['load-more'] = true;
  18. return obj;
  19. });
  20. /**
  21. * 点击事件
  22. * 分发ID值
  23. */
  24. const handleClick = () => {
  25. if (!props.can_loadmore) {
  26. return;
  27. }
  28. emit('loadmore');
  29. };
  30. </script>
  31. <style lang="css" scoped>
  32. .history-item-icon {
  33. background-color: var(--color-bg-1);
  34. padding: 20px 30px 20px 30px;
  35. border-radius: 15px;
  36. margin-top: 10px;
  37. margin-bottom: 10px;
  38. color: var(--color-text-1);
  39. display: flex;
  40. justify-content: center;
  41. align-items: center;
  42. font-size: 13px;
  43. }
  44. .history-item-icon.can-loadmore {
  45. cursor: pointer;
  46. }
  47. </style>