|
|
@@ -2,6 +2,7 @@
|
|
|
// width: calc(950 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
|
|
|
|
|
|
import { onBeforeUnmount, ref } from 'vue'
|
|
|
+import { userAgentInfo } from '@/store/non-reactive.js'
|
|
|
|
|
|
export default function useSizeAdapt(windowWidthWhenDesign = 1920, windowHeightWhenDesign = 1080) {
|
|
|
const windowSizeInCssForRef = ref('')
|
|
|
@@ -18,10 +19,12 @@ export default function useSizeAdapt(windowWidthWhenDesign = 1920, windowHeightW
|
|
|
}
|
|
|
|
|
|
compute()
|
|
|
- window.addEventListener('resize', compute)
|
|
|
- onBeforeUnmount(() => {
|
|
|
- window.removeEventListener('resize', compute)
|
|
|
- })
|
|
|
+ if (userAgentInfo.device.type !== 'mobile' || userAgentInfo.os.name === 'iOS' || (userAgentInfo.browser.name !== 'WeChat' && !userAgentInfo.browser.name.includes('huawei'))) {
|
|
|
+ window.addEventListener('resize', compute)
|
|
|
+ onBeforeUnmount(() => {
|
|
|
+ window.removeEventListener('resize', compute)
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
return {
|
|
|
windowSizeInCssForRef,
|