From 416ef077b916de27c88439d2fb679691e85df743 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Fri, 12 Jun 2026 16:40:53 +0800
Subject: [PATCH] 1
---
src/page/kline/index.vue | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/page/kline/index.vue b/src/page/kline/index.vue
index 1d0ecc9..7678659 100644
--- a/src/page/kline/index.vue
+++ b/src/page/kline/index.vue
@@ -494,13 +494,19 @@
this.getNohknews();
},
beforeDestroy() {
- this.clearInterval(this.timer); // 在组件销毁前清除定时器
+ this.clearStockTimer();
},
// beforeDestroy() {
// this.Klinetype = false;
// window.clearInterval()
// },
methods: {
+ clearStockTimer() {
+ if (this.timer) {
+ clearInterval(this.timer);
+ this.timer = null;
+ }
+ },
async getHknews() {
await api.queryIndexNews().then((res) => {
if (res.status === 0) {
@@ -649,7 +655,7 @@
}
},
handleBackaa() {
- clearInterval(this.timer);
+ this.clearStockTimer();
window.localStorage.removeItem("kLine");
this.$router.go(-1);
},
@@ -665,7 +671,7 @@
});
},
goBuy(index) {
- clearInterval(this.timer);
+ this.clearStockTimer();
this.$router.push({
path: "/TradingBuy",
query: {
--
Gitblit v1.9.3