Forráskód Böngészése

更新 雷达图实例清除

wzh 3 éve
szülő
commit
0c2902bf1c
1 módosított fájl, 5 hozzáadás és 1 törlés
  1. 5 1
      src/components/Radar.vue

+ 5 - 1
src/components/Radar.vue

@@ -5,7 +5,7 @@
 </template>
 
 <script>
-import { ref, onMounted, computed, inject } from "vue";
+import { ref, onMounted, computed, inject, onBeforeUnmount } from "vue";
 import { mapState } from "vuex";
 import exchangeUrl from "utils/exchangeUrl";
 
@@ -95,6 +95,10 @@ export default {
         init();
       }, 100);
     });
+
+    onBeforeUnmount(() => {
+      radarChart.value.dispose();
+    });
     return {
       init,
       exchangeUrl,