This commit is contained in:
汪汇 2024-07-24 15:24:29 +08:00
parent e6e2092913
commit 915a79c8a7
1 changed files with 21 additions and 10 deletions

View File

@ -13,8 +13,19 @@
<script setup>
import Header from "../components/header.vue";
import { ref, onMounted, onBeforeMount } from "vue";
import { ref, onMounted, onBeforeMount ,watch} from "vue";
import { useRouter, useRoute } from "vue-router";
const router = useRouter();
const routers = useRoute();
console.log(routers.path);
watch(
() => routers.path,
(newVal, oldVal) => {
if (routers.path == '/home/index/map') {
reset_font()
}
}
);
const reset_font = () => {
let width = document.documentElement.clientWidth || document.body.clientWidth;
let height =
@ -30,7 +41,7 @@ const reset_font = () => {
document.querySelector(".header_content").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")";
if (
document.querySelector(".left").style){
document.querySelector(".left")) {
document.querySelector(".left").style.transformOrigin = "bottom left";
document.querySelector(".left").style.transform =
"scale(" + width / 1920 + "," + height / 1080 + ")";