|
@@ -31,7 +31,7 @@ import flop from "../components/flop/index.vue";
|
|
|
import { ref, computed, onMounted, inject, nextTick } from "vue";
|
|
|
import { deviceDetection } from "../utils/deviceDetection";
|
|
|
import { echartsJson } from "../api/mock";
|
|
|
-import { useEventListener } from "@vueuse/core";
|
|
|
+import { useEventListener, tryOnUnmounted } from "@vueuse/core";
|
|
|
|
|
|
let brokenLine: any = null; //折线图实例
|
|
|
export default {
|
|
@@ -188,6 +188,12 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ tryOnUnmounted(() => {
|
|
|
+ if (!brokenLine) return;
|
|
|
+ brokenLine.dispose();
|
|
|
+ brokenLine = null;
|
|
|
+ });
|
|
|
+
|
|
|
return {
|
|
|
greetings,
|
|
|
mobile,
|