sinake
2026-11-10 5cfc1a3436cb167138e3460612587fc3b7ccfde1
src/views/home/components/lineChart/index.vue
@@ -36,9 +36,17 @@
  },
  data() {
    return {
      options: {}
      options: {},
      // 自动轮播定时器句柄;不清理会在组件销毁后继续触发,导致对已销毁实例操作
      intervalId: null
    };
  },
  beforeDestroy() {
    if (this.intervalId !== null) {
      clearInterval(this.intervalId);
      this.intervalId = null;
    }
  },
  components: {
    Echart
  },