gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!-- 消息列表为空时,展示 prompt 列表 -->
<script setup lang="ts">
const emits = defineEmits(['onPrompt']);
 
const promptList = [
  {
    prompt: '今天气怎么样?',
  },
  {
    prompt: '写一首好听的诗歌?',
  },
]; // prompt 列表
 
/** 选中 prompt 点击 */
async function handlerPromptClick(prompt: any) {
  emits('onPrompt', prompt.prompt);
}
</script>
<template>
  <div class="relative flex h-full w-full flex-row justify-center">
    <div class="flex flex-col justify-center">
      <!-- title -->
      <div class="text-center text-3xl font-bold">芋道 AI</div>
      <!-- role-list -->
      <div class="mt-5 flex w-96 flex-wrap items-center justify-center">
        <div
          v-for="prompt in promptList"
          :key="prompt.prompt"
          @click="handlerPromptClick(prompt)"
          class="m-2.5 flex w-44 cursor-pointer justify-center rounded-lg border border-gray-200 leading-10 hover:bg-gray-100"
        >
          {{ prompt.prompt }}
        </div>
      </div>
    </div>
  </div>
</template>