From bdafa2d0830c55eb6541e270e7eb97c4a0404281 Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Sat, 15 Mar 2025 16:30:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=A4=BA=E4=BE=8B=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=92=8C=E4=BE=9D=E8=B5=96=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E5=85=A8=E5=B1=80=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 2 + assets/css/main.css | 1 + components/ChatMessage.vue | 51 +++++++ components/PopularInquiries.vue | 5 + layouts/default.vue | 51 ++++++- nuxt.config.ts | 10 +- package.json | 5 + pages/index.vue | 232 +++++++++++++++++++++++++------- pnpm-lock.yaml | 92 +++++++++++++ stores/state.ts | 51 +++++++ types/index.ts | 29 ++++ 11 files changed, 476 insertions(+), 53 deletions(-) create mode 100644 .env.example create mode 100644 components/ChatMessage.vue create mode 100644 stores/state.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e823eea --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +DIFY_BASE_URL= +DIFY_API_KEY= diff --git a/assets/css/main.css b/assets/css/main.css index d955357..6a76cdd 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,4 +1,5 @@ @import "tailwindcss" theme(static); +@plugin "@tailwindcss/typography"; @import "@nuxt/ui"; @theme static { diff --git a/components/ChatMessage.vue b/components/ChatMessage.vue new file mode 100644 index 0000000..4571cc0 --- /dev/null +++ b/components/ChatMessage.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/components/PopularInquiries.vue b/components/PopularInquiries.vue index 3a0402d..7e8107c 100644 --- a/components/PopularInquiries.vue +++ b/components/PopularInquiries.vue @@ -8,6 +8,10 @@ const props = defineProps({ }, }); +const emit = defineEmits({ + "select-inquiry": (inquiry: string) => true, +}); + const activeTab = ref("0"); @@ -37,6 +41,7 @@ const activeTab = ref("0"); size="sm" block :key="inquiry.question" + @click="() => emit('select-inquiry', inquiry.question)" > {{ inquiry.question }} diff --git a/layouts/default.vue b/layouts/default.vue index 1c6b873..03c8524 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,11 +1,54 @@ - +