kidArtExpo/src/views/login/index.vue

28 lines
600 B
Vue
Raw Normal View History

2024-08-05 11:36:27 +00:00
<script setup>
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-06 09:07:36 +00:00
import {computed} from "vue";
const {maxWidth}= useAdaptation(sizes,(maxWidth)=>{
2024-08-06 11:58:33 +00:00
console.log('maxWidth',maxWidth.value)
2024-08-06 09:07:36 +00:00
})
2024-08-06 11:58:33 +00:00
2024-08-06 09:07:36 +00:00
const viewComponent = computed(()=>{
switch (maxWidth.value){
case '375px':
return size375
2024-08-06 11:58:33 +00:00
case '768px':
return size768
2024-08-06 09:07:36 +00:00
}
})
2024-08-05 11:36:27 +00:00
</script>
<template>
2024-08-06 09:07:36 +00:00
<component :is="viewComponent"></component>
2024-08-05 11:36:27 +00:00
</template>
<style scoped lang="scss">
</style>