{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/layout/mixin/ResizeHandler.js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/layout/mixin/ResizeHandler.js","mtime":1701742078550},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/babel.config.js","mtime":1701742078504},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000}],"contextDependencies":[],"result":["// +----------------------------------------------------------------------\n// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]\n// +----------------------------------------------------------------------\n// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.\n// +----------------------------------------------------------------------\n// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权\n// +----------------------------------------------------------------------\n// | Author: CRMEB Team <admin@crmeb.com>\n// +----------------------------------------------------------------------\n\nimport store from '@/store';\nvar _document = document,\n  body = _document.body;\nvar WIDTH = 992; // refer to Bootstrap's responsive design\n\nexport default {\n  watch: {\n    $route: function $route() {\n      if (this.device === 'mobile' && this.sidebar.opened) {\n        store.dispatch('app/closeSideBar', {\n          withoutAnimation: false\n        });\n      }\n    }\n  },\n  beforeMount: function beforeMount() {\n    window.addEventListener('resize', this.$_resizeHandler);\n  },\n  beforeDestroy: function beforeDestroy() {\n    window.removeEventListener('resize', this.$_resizeHandler);\n  },\n  mounted: function mounted() {\n    var isMobile = this.$_isMobile();\n    if (isMobile) {\n      store.dispatch('app/toggleDevice', 'mobile');\n      store.dispatch('app/closeSideBar', {\n        withoutAnimation: true\n      });\n    }\n  },\n  methods: {\n    // use $_ for mixins properties\n    // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential\n    $_isMobile: function $_isMobile() {\n      var rect = body.getBoundingClientRect();\n      return rect.width - 1 < WIDTH;\n    },\n    $_resizeHandler: function $_resizeHandler() {\n      if (!document.hidden) {\n        var isMobile = this.$_isMobile();\n        store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop');\n        if (isMobile) {\n          store.dispatch('app/closeSideBar', {\n            withoutAnimation: true\n          });\n        }\n      }\n    }\n  }\n};",null]}