From 18e4df43f79f51539474b2918544a9d2d4c5c4e0 Mon Sep 17 00:00:00 2001 From: wangfei <3597712270@qq.com> Date: 星期三, 13 十一月 2024 15:43:52 +0800 Subject: [PATCH] 前端页面适配 --- UI-Project/src/App.vue | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/UI-Project/src/App.vue b/UI-Project/src/App.vue index e15be3b..98d1a20 100644 --- a/UI-Project/src/App.vue +++ b/UI-Project/src/App.vue @@ -1,14 +1,23 @@ <template> - <router-view></router-view> - </template> <script setup> -import {ref} from 'vue' -import { RouterView } from 'vue-router' +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> +/* 浣犵殑鏍峰紡鍐呭 */ +</style> \ No newline at end of file -- Gitblit v1.8.0