|
@@ -44,7 +44,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { useWindowSize } from '@vueuse/core'
|
|
|
-import { computed, inject, ref } from 'vue'
|
|
|
+import { computed, inject, ref, onMounted } from 'vue'
|
|
|
import ToastComp from "@/components/ToastComp.vue"
|
|
|
import { isShowToast } from "@/store/index.js"
|
|
|
import { useRoute, useRouter } from "vue-router"
|
|
@@ -64,6 +64,27 @@ console.log(windowWidth)
|
|
|
const windowOrientation = computed(() => {
|
|
|
return windowWidth.value >= windowHeight.value ? 'landscape' : 'portrait'
|
|
|
})
|
|
|
+
|
|
|
+const time = ref({
|
|
|
+ current: null
|
|
|
+})
|
|
|
+onMounted(() => {
|
|
|
+ // 移动端
|
|
|
+ window.addEventListener(
|
|
|
+ "resize",
|
|
|
+ () => {
|
|
|
+ // @ts-ignore
|
|
|
+ clearTimeout(time.value.current)
|
|
|
+ time.value.current = window.setTimeout(() => {
|
|
|
+ const dom = document.querySelector("#app")
|
|
|
+ if (dom && document.documentElement.clientWidth < 480) {
|
|
|
+ dom.style.height = document.documentElement.clientHeight + "px"
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+ },
|
|
|
+ true
|
|
|
+ )
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|