src/store/onresize.js
@@ -1,20 +1,25 @@
import _this from '../main'
import _this from "../main";
// 设置 init 函数
function init() {
    if (_this) {
        let innerWH = {
            innerWidth: window.innerWidth,
            innerHeight: window.innerHeight,
      innerHeight: window.innerHeight
            // innerWidth: document.documentElement.clientWidth,
            // innerHeight: document.documentElement.clientHeight,
        }
        _this.$store.commit('setWindowSize', innerWH);
    };
    _this.$store.commit("setWindowSize", innerWH);
    _this.$store.commit("setWindowSizeHeight", innerWH.innerHeight);
    _this.$store.commit("setScreenSize", {
      w: window.screen.width,
      h: window.screen.height
    });
    // console.log("第下次判断屏幕分辨率");
        // console.log(' window.innerWidth', window.innerWidth);
        // console.log(' window.innerHeight', window.innerHeight);
        _this.$store.dispatch("changeZoom");
    }
}
@@ -33,10 +38,14 @@
//         lastClick = Date.now();
//     }
// }
window.addEventListener('resize', () => {
window.addEventListener(
  "resize",
  () => {
    // 节流 
    if (Date.now() - lastClick >= ms) {
        init();
        lastClick = Date.now();
    }
}, false)
  },
  false
);