yxh
yxh
10 天以前 8171fac4d00c3dcbb33d82043ef4a5923694aec4
src/views/home/components/BarChart/index.vue
@@ -37,8 +37,16 @@
  data() {
    return {
      options: {},
      // 自动轮播定时器句柄;不清理会在组件销毁后继续触发,导致对已销毁实例操作
      intervalId: null,
    };
  },
  beforeDestroy() {
    if (this.intervalId !== null) {
      clearInterval(this.intervalId);
      this.intervalId = null;
    }
  },
  components: {
    Echart,
  },