Explorar o código

fix 改变大小缩放

wenhongquan %!s(int64=3) %!d(string=hai) anos
pai
achega
74f882b348
Modificáronse 2 ficheiros con 4 adicións e 3 borrados
  1. 3 0
      index.html
  2. 1 3
      src/components/MapView/index.tsx

+ 3 - 0
index.html

@@ -137,6 +137,9 @@
                 if (t != 1 && !isMac) { // 如果进行了缩放,也就是不是1
                     setTimeout(() => {
                         document.body.style.zoom = -0.6 * t + 1.55; // 就去修改页面的缩放比例,这个公式我自己算的,不准确,勉强。
+                        if (window.map != undefined) {
+                            map.resize();
+                        }
                     }, 3 * 1000)
                 } else {
                     document.body.style.zoom = "normal";

+ 1 - 3
src/components/MapView/index.tsx

@@ -99,9 +99,7 @@ export default defineComponent({
       });
       map["tipcontentRef"] = tipcontentRef.value;
       ctx.emit('update:map', map);
-       window.onresize = () => {
-         map.resize();
-       };
+      window["map"] = map;
     });