|
@@ -15,7 +15,7 @@
|
|
|
import vaside from "./aside.vue";
|
|
|
import maps from "@/components/maps";
|
|
|
import emitter from "@/mitt/index";
|
|
|
-import { ref, defineEmits, onMounted, watch, computed, nextTick } from "vue";
|
|
|
+import { ref, defineEmits, onMounted, watch, computed, nextTick, onUnmounted } from "vue";
|
|
|
import { Loading } from "@/components/UI";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
|
|
@@ -46,8 +46,7 @@ emitter.on("handleHover", (data) => {
|
|
|
|
|
|
const asideRef = ref(null);
|
|
|
|
|
|
-
|
|
|
-emitter.on("handleClick", (data) => {
|
|
|
+const handleClick = (data) => {
|
|
|
if (data.num == " 0") {
|
|
|
return;
|
|
|
}
|
|
@@ -70,11 +69,16 @@ emitter.on("handleClick", (data) => {
|
|
|
// type: listType,
|
|
|
// }
|
|
|
// })
|
|
|
-});
|
|
|
+}
|
|
|
|
|
|
onMounted(() => {
|
|
|
Loading.hide();
|
|
|
+ emitter.on("handleClick", handleClick);
|
|
|
});
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ emitter.off('handleClick', handleClick)
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|