From f0314187e5bd4c147f5d672001b9154f5d891322 Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Mon, 7 Jul 2025 17:57:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(stock):=E4=BF=AE=E6=AD=A3=E5=BC=80=E7=9B=98?= =?UTF-8?q?=E4=BB=B7=E6=95=B0=E6=8D=AE=E6=BA=90=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=BF=B7=E4=BD=A0=E5=88=86=E6=97=B6=E5=9B=BE=E6=B8=B2=E6=9F=93?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 stock.vue 中的开盘价数据源从"今日开盘价"改为"昨日收盘价" - 在 stockSparkLine.vue 中修改图表初始化方式,使用 document.getElementById 获取图表容器 -为 stockSparkLine.vue 中的图表容器添加唯一的 id 属性,以确保正确渲染多个图表 --- frontend/src/components/stock.vue | 2 +- frontend/src/components/stockSparkLine.vue | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/stock.vue b/frontend/src/components/stock.vue index cafaf44..b282f38 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 30a2e56..29a5fe8 100644 --- a/frontend/src/components/stockSparkLine.vue +++ b/frontend/src/components/stockSparkLine.vue @@ -114,7 +114,8 @@ function setChartData(chart) { } onMounted(() => { - const chart = echarts.init(chartRef.value); + + const chart = echarts.init( document.getElementById('sparkLine'+stockCode)); setChartData(chart); // setInterval(() => { @@ -123,6 +124,6 @@ onMounted(() => { }) \ No newline at end of file