wangfei
2024-11-13 18e4df43f79f51539474b2918544a9d2d4c5c4e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<template>
  <router-view></router-view>
</template>
<script setup>
import {onMounted} from 'vue'
import DevicePixelRatio from '@/utils/evicePixelRatio.js';
 
// 定义一个函数来调整 body 的缩放比例
function bodyScale() {
  const deviceheight = document.documentElement.clientHeight;
  const scale = deviceheight / 740;
  document.body.style.zoom = scale;
}
 
// 在组件挂载时执行
onMounted(() => {
  new DevicePixelRatio().init();
  bodyScale();
});
</script>
<style scoped>
/* 你的样式内容 */
</style>