chatList.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div class="chat-list">
  3. <chatItem
  4. v-for="(item, index) in chat_list"
  5. :key="index"
  6. :dialog="item"
  7. :type="type"
  8. :target_agent_icon="target_agent_icon"
  9. @update="handleUpdate"
  10. @merge="toMerge"
  11. @update_outline="toUpdateOutLine"
  12. @confirm_outline="toConfirmOutLine"
  13. ></chatItem>
  14. </div>
  15. </template>
  16. <script setup>
  17. import chatItem from './chatItem.vue';
  18. const props = defineProps({
  19. chat_list: {
  20. type: Array,
  21. default: () => []
  22. },
  23. type: {
  24. type: String,
  25. default: 'znwd'
  26. },
  27. target_agent_icon: {
  28. type: String,
  29. default: 'icon_1'
  30. }
  31. });
  32. const emit = defineEmits(['update', 'merge', 'update_outline', 'confirm_outline']);
  33. const handleUpdate = (icon) => {
  34. emit('update', icon);
  35. };
  36. const toMerge = (data) => {
  37. emit('merge', data);
  38. };
  39. const toUpdateOutLine = (data) => {
  40. console.log(data, 111);
  41. emit('update_outline', data);
  42. };
  43. const toConfirmOutLine = (data) => {
  44. emit('confirm_outline', data);
  45. };
  46. </script>
  47. <style scoped lang="css">
  48. .chat-list {
  49. /* margin-top: 80px; */
  50. width: 100%;
  51. }
  52. </style>