调试
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<van-config-provider :theme="theme" class="app-root">
|
||||
<pre
|
||||
style="position:fixed; left:0; top:0; z-index:9999;
|
||||
background:rgba(0,0,0,0.7); color:#0f0;
|
||||
font-size:10px; max-height:50vh; overflow:auto;">
|
||||
{{ log }}
|
||||
</pre>
|
||||
|
||||
<div class="app-main">
|
||||
<RouterView />
|
||||
</div>
|
||||
@@ -24,8 +31,32 @@
|
||||
import { RouterView, useRoute } from 'vue-router'
|
||||
import { ref, onMounted, onUnmounted, computed } from 'vue'
|
||||
|
||||
const route = useRoute()
|
||||
const log = ref('')
|
||||
|
||||
const updateInfo = () => {
|
||||
log.value = JSON.stringify({
|
||||
innerHeight: window.innerHeight,
|
||||
outerHeight: window.outerHeight,
|
||||
documentElementClientHeight: document.documentElement.clientHeight,
|
||||
viewport: window.visualViewport
|
||||
? {
|
||||
height: window.visualViewport.height,
|
||||
offsetTop: window.visualViewport.offsetTop,
|
||||
}
|
||||
: null,
|
||||
}, null, 2)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
updateInfo()
|
||||
window.addEventListener('resize', updateInfo)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', updateInfo)
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
// 根据路由判断是否显示Tabbar
|
||||
const showTabbar = computed(() => {
|
||||
return route.path === '/' ||
|
||||
|
||||
Reference in New Issue
Block a user