Browse Source

解决屏幕分辨率小于客户端分辨率显示不全的bug

liuwei 4 years ago
parent
commit
b07f9a3130
1 changed files with 9 additions and 6 deletions
  1. 9 6
      src/renderer/App.vue

+ 9 - 6
src/renderer/App.vue

@@ -53,12 +53,15 @@
       })
 
       // 更新vuex中的缩放比例
-      // axios.get('static/Data/EnityWindow.Data').then(async res => {
-      //   if (res.status === 200) {
-      //         const bigScale = window.screen.height/res.data[0].Height
-      //         this.$store.dispatch('updateScale',bigScale)
-      //     }
-      // })
+      axios.get('static/Data/EnityWindow.Data').then(async res => {
+        if (res.status === 200) {
+              // 当屏幕分辨率小于客户端分辨率时,所有元素大小位置同样缩小
+              if(window.screen.width<res.data[0].Width){
+                const bigScale = window.screen.width/res.data[0].Width
+                this.$store.dispatch('updateScale',bigScale)
+              }
+          }
+      })
     }
   }
 </script>