fix: echart not render in production

This commit is contained in:
xiaoxian521 2021-04-11 22:21:44 +08:00
parent 57ee746489
commit 68330026b6

View File

@ -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,