任一存 2 роки тому
батько
коміт
810c5b79b1
2 змінених файлів з 9 додано та 5 видалено
  1. 1 1
      code/src/views/gdmuseum/mobile.vue
  2. 8 4
      code/src/views/home/index.vue

+ 1 - 1
code/src/views/gdmuseum/mobile.vue

@@ -93,7 +93,7 @@ onMounted(() => {
   overflow-y: auto;
   overflow-x: hidden;
   height: calc(100% - 60px);
-
+  padding-bottom: 60px;
   .info {
     padding-top: 20px;
     width: 90%;

+ 8 - 4
code/src/views/home/index.vue

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