From 651c8edc8df77edec154b67455debf88bf78f203 Mon Sep 17 00:00:00 2001 From: liaoxinyu Date: Mon, 2 Sep 2024 09:14:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/handicap.vue | 8 +++++++- src/views/contract/index.vue | 4 ++++ src/vuex/store.js | 12 +++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/views/contract/handicap.vue b/src/views/contract/handicap.vue index 794e713..77f063c 100644 --- a/src/views/contract/handicap.vue +++ b/src/views/contract/handicap.vue @@ -69,6 +69,7 @@
{{ price1 }} +
@@ -189,7 +190,10 @@ export default { item.total = item.total.toFixed(3); }); return list; - } + }, + // set_price() { + // return this.$store.getters.set_price; // 从 Vuex 获取共享值 + // } }, created() { if (this.symbol) { @@ -228,6 +232,7 @@ export default { this.buyList = res.swapBuyList; this.tradeList = res.swapTradeList; this.newPriceObj = this.tradeList[0]; + this.$store.commit('SET_PRICE', this.newPriceObj.price); this.$emit("input", this.newPriceObj); }); }, @@ -281,6 +286,7 @@ export default { this.tradeList.pop(); this.newPriceObj = data; localStorage.setItem("price",this.newPriceObj.price) + // this.$store.commit('SET_PRICE', this.newPriceObj.price); this.$emit("input", this.newPriceObj); } else if (type == "ping" ||cmd == "ping") { this.ws.send({ diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue index 4180f6e..653c1e4 100644 --- a/src/views/contract/index.vue +++ b/src/views/contract/index.vue @@ -21,6 +21,7 @@ increase: activeContract.increase >= 0 }"> {{ price1 }} +