From de2fad19e7f95633ad7857a7883ab8997799d302 Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Fri, 14 Mar 2025 10:44:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=88=E7=BA=A6=E4=BF=9D?= =?UTF-8?q?=E8=AF=81=E9=87=91=E4=B8=BA2=E4=BD=8D=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/index.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue index 4a1c747..7e224e2 100644 --- a/src/views/contract/index.vue +++ b/src/views/contract/index.vue @@ -199,7 +199,9 @@ export default { symbolDetail:{}, currentIcon: '', imge:[], - Liste:[] + Liste:[], + price1:0, + intervalId:'' }; }, computed: { @@ -246,6 +248,7 @@ export default { if(item.symbol==this.activeContract.symbol) item.realtimePrice=this.activeContract.price }) }); + this.startWatchingPrice() }, //三秒更新一次数据 mounted: function () { @@ -255,6 +258,12 @@ export default { }, 2000) }, methods: { + startWatchingPrice(){ + this.intervalId = setInterval(() => { + let newPrice = localStorage.getItem('price'); + this.price1 = newPrice; + }, 10); // 每秒检查一次 + }, ispopover1(item){ this.activeSymbol=item; this.getMarketList();