Hwf 6 mēneši atpakaļ
vecāks
revīzija
86f5fd540f
2 mainītis faili ar 5 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/components/Map/map.scss
  2. 4 0
      src/hooks/AMap/useAMap.ts

+ 1 - 1
src/components/Map/map.scss

@@ -25,7 +25,7 @@ $vh_base: 2520;
     overflow-y: auto;
     width: 100%;
     &::-webkit-scrollbar {
-      width: vw(6);
+      width: vw(12);
     }
   }
   .table {

+ 4 - 0
src/hooks/AMap/useAMap.ts

@@ -208,9 +208,13 @@ export function useAMap(options) {
     // 打开InfoWindow,并设置其内容和位置
     infoWindow.setContent(content);
     infoWindow.open(map, lnglat);
+    // 解决2.0版本无法滚动问题
+    infoWindow.on('mouseover', () => map.setStatus({ zoomEnable: false }));
+    infoWindow.on('mouseout', () => map.setStatus({ zoomEnable: true }));
   };
 
   const hideInfo = (e) => {
+    map.setStatus({ zoomEnable: true });
     if (!!infoWindow) {
       infoWindow.close();
       if (!!clickMarker && e) {