You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

3 years ago
<template>
3 years ago
<Header v-if="showHeader" />
3 years ago
<router-view />
3 years ago
</template>
<script lang="ts">
3 years ago
import { onMounted, reactive, ref, toRefs, watch } from 'vue';
3 years ago
import { useRouter } from 'vue-router';
3 years ago
import Header from './components/Shared/Header.vue';
3 years ago
3 years ago
export default {
name: 'App',
3 years ago
components: {Header},
3 years ago
setup() {
3 years ago
const router = useRouter();
const showHeader = ref(false);
3 years ago
onMounted(() => {
getRem(1920, 100);
window.onresize = () => getRem(1920, 100);
})
3 years ago
3 years ago
watch(() => router.currentRoute.value.path,
(current, prev) => {
showHeader.value = current === "/Login" ? false : true;
}
);
3 years ago
const getRem = (pwidth, prem) => {
let html = document.getElementsByTagName("html")[0];
let oWidth = document.body.clientWidth || document.documentElement.clientWidth;
html.style.fontSize = oWidth / pwidth*prem + "px";
}
3 years ago
return {showHeader}
3 years ago
}
}
</script>
<style>
@import "element-plus/theme-chalk/index.css";
</style>