| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <!--
- * @Author: wjc
- * @Date: 2023-11-15 09:54:21
- * @LastEditors: LiZhiWei
- * @LastEditTime: 2026-01-15 14:50:45
- * @Description:
- -->
- <template>
- <NuxtLayout>
- <el-config-provider :size="elConfig.size" :z-index="elConfig.zIndex" :locale="zhCn">
- <NuxtPage />
- </el-config-provider>
- </NuxtLayout>
- </template>
- <script setup lang="ts">
- import zhCn from 'element-plus/es/locale/lang/zh-cn'
- import { appName } from '~/constants'
- useHead({
- title: appName,
- })
- const elConfig = ref<{
- size: 'default' | 'small' | 'large'
- zIndex: number
- }>({
- size: 'default',
- zIndex: 300,
- })
- if (import.meta.client) {
- const handleResize = () => {
- const width = window.innerWidth
- if (width >= 768 && width <= 1440) {
- // @ts-ignore
- document.documentElement.style.zoom = width / 1440
- } else {
- // @ts-ignore
- document.documentElement.style.zoom = 1
- }
- }
- onMounted(() => {
- window.addEventListener('resize', handleResize)
- handleResize()
- })
- onUnmounted(() => {
- window.removeEventListener('resize', handleResize)
- })
- }
- </script>
- <style lang="scss">
- html {
- /**
- 一般浏览器的默认字体大小为 16px,以10px 为基数计算rem,font-size: 1.4rem = 14px;
- 注意:此设置在媒体查询中无效,媒体查询中,基数还是16px
- */
- font-size: 62.5%;
- }
- html,
- body,
- #__nuxt {
- padding: 0;
- margin: 0;
- height: 100%;
- }
- </style>
|