From 642f7990dce71514492ff281f919f9b79c0f9870 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 8 Feb 2026 17:19:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E7=9A=84YES/NO=E5=BC=B9=E5=87=BA=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MarketCard.vue | 26 ++++- src/components/TradeComponent.vue | 152 +++++++++++++++++++++++++++++- src/views/Home.vue | 66 ++++++++++++- 3 files changed, 234 insertions(+), 10 deletions(-) diff --git a/src/components/MarketCard.vue b/src/components/MarketCard.vue index 3a49085..9fb1b59 100644 --- a/src/components/MarketCard.vue +++ b/src/components/MarketCard.vue @@ -31,12 +31,24 @@ - +
- + Yes - + No
@@ -58,6 +70,9 @@ import { computed } from 'vue' import { useRouter } from 'vue-router' const router = useRouter() +const emit = defineEmits<{ + openTrade: [side: 'yes' | 'no', market?: { id: string; title: string }] +}>() const props = defineProps({ marketTitle: { @@ -114,6 +129,11 @@ const navigateToDetail = () => { }, }) } + +// 点击 Yes/No 时弹出交易框(由父组件监听 openTrade 并打开弹层) +function openTrade(side: 'yes' | 'no') { + emit('openTrade', side, { id: props.id, title: props.marketTitle }) +}