交易所前端蓝色ui 4.5 jiem
lxf
2025-04-18 02a3d94d359b34e915f34abec024cbc1504a6a7c
src/components/commonTrade/kline.vue
@@ -1,6 +1,7 @@
<template>
  <div class="kline-page">
    <div
      v-if="isVisible"
      id="kline-BoxMain"
      :style="{ width: width != 0 ? width + 'px' : '' }"
      :class="[
@@ -132,6 +133,7 @@
  },
  data() {
    return {
      isVisible: true,
      klineData: null,
      paneId: undefined,
      mssg: "",
@@ -182,9 +184,20 @@
        });
      }
    },
    "$route.query.timestamp"(newVal, oldVal) {
      // 当 timestamp 参数变化时执行
      if (newVal !== oldVal) {
        this.klineInIt(newVal); // 调用数据更新方法
      }
    },
  },
  methods: {
    klineInIt() {
    klineInIt(newVal) {
      if (this.klineData && newVal) {
        this.klineData = null;
        this.isVisible = false;
        this.klineData.remove(); // 销毁旧的图表实例
      }
      this.klineData = init("kline-BoxMain", {
        locale: langStore.language, //https://klinecharts.com/guide/i18n.html
        styles: {
@@ -263,6 +276,7 @@
          },
        },
      });
      this.isVisible = true;
      this.klineData.createIndicator("MA", false, {
        id: "candle_pane",