From c180c2a5f8d492ec7329136a67cb86e560d4d67e Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Tue, 8 Jul 2025 10:58:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(stock):=E4=BC=98=E5=8C=96=E8=82=A1?= =?UTF-8?q?=E7=A5=A8=E8=BF=B7=E4=BD=A0=E5=9B=BE=E5=88=B7=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 Stock 组件中添加 lastPrice 属性,传递当前价格给 StockSparkLine 组件 - 在 StockSparkLine 组件中接收 lastPrice 属性,并使用它来更新 K 线图数据 - 优化 StockSparkLine 组件的渲染逻辑,使用 onMounted 和 watchEffect --- frontend/src/components/stock.vue | 2 +- frontend/src/components/stockSparkLine.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/stock.vue b/frontend/src/components/stock.vue index eac9759..4ee8f1d 100644 --- a/frontend/src/components/stock.vue +++ b/frontend/src/components/stock.vue @@ -1815,7 +1815,7 @@ function searchStockReport(stockCode) { - + diff --git a/frontend/src/components/stockSparkLine.vue b/frontend/src/components/stockSparkLine.vue index 78f9a55..26c7797 100644 --- a/frontend/src/components/stockSparkLine.vue +++ b/frontend/src/components/stockSparkLine.vue @@ -125,7 +125,7 @@ onMounted(() => { watchEffect(() => { - //console.log(stockName,'lastPrice变化为:', lastPrice) + console.log(stockName,'lastPrice变化为:', lastPrice,lastPrice > openPrice) setChartData(chart.value); })