yxh
yxh
10 天以前 8171fac4d00c3dcbb33d82043ef4a5923694aec4
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
  },