ChatEmpty.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="chat-empty">
  3. <!-- title -->
  4. <div class="center-container">
  5. <div class="title">芋艿 AI</div>
  6. <div class="role-list">
  7. <div class="role-item" v-for="prompt in promptList" :key="prompt.prompt" @click="handlerPromptClick(prompt)">
  8. {{prompt.prompt}}
  9. </div>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script setup lang="ts">
  15. const promptList = ref<any[]>() // 角色列表
  16. promptList.value = [
  17. {
  18. "prompt": "今天气怎么样?",
  19. },
  20. {
  21. "prompt": "写一首好听的诗歌?",
  22. }
  23. ]
  24. const emits = defineEmits(['onPrompt'])
  25. const handlerPromptClick = async ({ prompt }) => {
  26. emits('onPrompt', prompt)
  27. }
  28. </script>
  29. <style scoped lang="scss">
  30. .chat-empty {
  31. position: relative;
  32. display: flex;
  33. flex-direction: row;
  34. justify-content: center;
  35. width: 100%;
  36. height: 100%;
  37. .center-container {
  38. display: flex;
  39. flex-direction: column;
  40. justify-content: center;
  41. .title {
  42. font-size: 28px;
  43. font-weight: bold;
  44. text-align: center;
  45. }
  46. .role-list {
  47. display: flex;
  48. flex-direction: row;
  49. flex-wrap: wrap;
  50. align-items: center;
  51. justify-content: center;
  52. width: 460px;
  53. margin-top: 20px;
  54. .role-item {
  55. display: flex;
  56. justify-content: center;
  57. width: 180px;
  58. line-height: 50px;
  59. border: 1px solid #e4e4e4;
  60. border-radius: 10px;
  61. margin: 10px;
  62. cursor: pointer;
  63. }
  64. .role-item:hover {
  65. background-color: rgba(243, 243, 243, 0.73);
  66. }
  67. }
  68. }
  69. }
  70. </style>