mobile.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <div class="mobile-layout">
  3. <Header />
  4. <main class="mobile-layout-main">
  5. <slot />
  6. </main>
  7. <Footer />
  8. </div>
  9. </template>
  10. <script setup>
  11. import Header from '~/components/mobile/Header.vue'
  12. import Footer from '~/components/mobile/Footer.vue'
  13. // const { width } = useWindowSize()
  14. // const updateRootFontSize = (value) => {
  15. // const baseWidth = 375
  16. // const baseFont = 37.5
  17. // const minFont = 32
  18. // const maxFont = 46
  19. // const nextFont = (value / baseWidth) * baseFont
  20. // const finalFont = Math.min(Math.max(nextFont, minFont), maxFont)
  21. // if (typeof document !== 'undefined') {
  22. // document.documentElement.style.fontSize = `${finalFont}px`
  23. // }
  24. // }
  25. // watchEffect(() => {
  26. // if (width.value > 0) {
  27. // updateRootFontSize(width.value)
  28. // }
  29. // })
  30. </script>
  31. <style scoped lang="scss">
  32. .mobile-layout {
  33. width: 100%;
  34. min-height: 100vh;
  35. background-color: #030014;
  36. display: flex;
  37. flex-direction: column;
  38. box-sizing: border-box;
  39. }
  40. .mobile-layout-main {
  41. flex: 1;
  42. width: 100%;
  43. padding: 60px 16px 16px;
  44. }
  45. </style>