调整封装的头部组件高度

This commit is contained in:
wangyifeng 2025-05-22 20:46:09 +08:00
parent c050a7cc43
commit a693dd53b2
3 changed files with 34 additions and 7 deletions

View File

@ -1,12 +1,22 @@
<script setup> <script setup>
import customHeader from '@/components/customHeader/index.vue' import size1920 from '@/views/home/size1920/index.vue'
import customFooter from '@/components/customFooter/index.vue' import size375 from '@/views/home/size375/index.vue'
import { computed } from 'vue'
import { useWindowSize } from '@vueuse/core'
const { width } = useWindowSize()
const viewComponent = computed(() => {
const viewWidth = width.value
if (viewWidth <= 450) {
return size375
} else if (viewWidth <= 1920 || viewWidth > 1920) {
return size1920
}
})
</script> </script>
<template> <template>
<customHeader /> <component :is="viewComponent" />
<router-view />
<customFooter />
</template> </template>
<style scoped lang="scss"></style> <style scoped lang="scss"></style>

View File

@ -1,13 +1,21 @@
<script setup> <script setup>
import { NCarousel, NDivider, NMarquee, NPopselect } from 'naive-ui' import { NCarousel, NDivider, NMarquee, NPopselect } from 'naive-ui'
import { onUnmounted, ref, watch, onMounted, computed } from 'vue' import { onUnmounted, ref, watch, onMounted, computed } from 'vue'
import customHeader from '@/components/customHeader/index.vue'
import customFooter from '@/components/customFooter/index.vue'
</script> </script>
<template> <template>
<!-- <header className="header"> <!-- <header className="header">
1920 1920
</header> --> </header> -->
<main ref="main"></main> <!-- <main ref="main"></main> -->
<customHeader />
<div style="margin: 80px 0;">
<router-view />
</div>
<customFooter />
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -1,13 +1,22 @@
<script setup> <script setup>
import { NCarousel, NDivider, NMarquee, NPopselect } from 'naive-ui' import { NCarousel, NDivider, NMarquee, NPopselect } from 'naive-ui'
import { onUnmounted, ref, watch, onMounted, computed } from 'vue' import { onUnmounted, ref, watch, onMounted, computed } from 'vue'
import customHeader from '@/components/customHeader/index.vue'
import customFooter from '@/components/customFooter/index.vue'
</script> </script>
<template> <template>
<!-- <header className="header"> <!-- <header className="header">
375 375
</header> --> </header> -->
<main ref="main"></main> <!-- <main ref="main"></main> -->
<customHeader />
<div style="margin: 80px 0;">
<router-view />
</div>
<customFooter />
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">