ChatEmpty.vue 1.6 KB

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