2024-08-05 11:36:27 +00:00
|
|
|
<script setup>
|
2024-08-07 12:00:54 +00:00
|
|
|
import {useAuth} from "@/store/auth/index.js";
|
2024-08-08 03:25:09 +00:00
|
|
|
|
2024-08-06 09:07:36 +00:00
|
|
|
import {useAdaptation} from "@/utils/self-adaption.js";
|
|
|
|
import {sizes} from "@/dict/index.js";
|
|
|
|
import size375 from '@/views/login/size375/index.vue'
|
2024-08-06 11:58:33 +00:00
|
|
|
import size768 from '@/views/login/size768/index.vue'
|
2024-08-07 03:51:02 +00:00
|
|
|
import size1440 from '@/views/login/size1440/index.vue'
|
|
|
|
import size1920 from '@/views/login/size1920/index.vue'
|
2024-08-06 09:07:36 +00:00
|
|
|
import {computed} from "vue";
|
2024-08-12 07:20:28 +00:00
|
|
|
import {useWindowSize } from '@vueuse/core';
|
2024-08-08 03:25:09 +00:00
|
|
|
const {clickSendCode}= useAuth()
|
|
|
|
const { width, height } = useWindowSize()
|
|
|
|
const isLandscape = computed(() => width.value > height.value)
|
2024-08-07 12:00:54 +00:00
|
|
|
const {currentRange }= useAdaptation(sizes)
|
2024-08-12 07:20:28 +00:00
|
|
|
localStorage.clear()
|
|
|
|
console.log('执行1111')
|
2024-08-06 09:07:36 +00:00
|
|
|
const viewComponent = computed(()=>{
|
2024-08-06 12:43:08 +00:00
|
|
|
switch (currentRange.value?.minWidth){
|
|
|
|
case '0px':
|
2024-08-06 09:07:36 +00:00
|
|
|
return size375
|
2024-08-06 11:58:33 +00:00
|
|
|
case '768px':
|
2024-08-08 03:25:09 +00:00
|
|
|
// 如果是ipad 横屏
|
|
|
|
if (isLandscape.value){
|
|
|
|
return size1440
|
|
|
|
}
|
2024-08-06 11:58:33 +00:00
|
|
|
return size768
|
2024-08-07 03:51:02 +00:00
|
|
|
case '1440px':
|
|
|
|
return size1440
|
|
|
|
case '1920px':
|
|
|
|
return size1920
|
2024-08-06 09:07:36 +00:00
|
|
|
}
|
|
|
|
})
|
2024-08-05 11:36:27 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-08-07 12:00:54 +00:00
|
|
|
<component @sendCode="clickSendCode" :is="viewComponent"></component>
|
2024-08-05 11:36:27 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
|
|
|
</style>
|