2 Commits
dev ... test

Author SHA1 Message Date
Zyronon
0478cc868c save 2024-06-06 16:46:04 +08:00
zyronon
8dcda1bd10 fix: root font-size automatic adaptation 2024-05-30 10:46:41 +08:00

View File

@@ -53,18 +53,19 @@ watch(
}
)
function setVh() {
function resetVhAndPx() {
let vh = window.innerHeight * 0.01
document.documentElement.style.setProperty('--vh', `${vh}px`)
//document.documentElement.style.fontSize = document.documentElement.clientWidth / 375 + 'px'
}
onMounted(() => {
store.init()
setVh()
resetVhAndPx()
// 监听resize事件 视图大小发生变化就重新计算1vh的值
window.addEventListener('resize', () => {
location.href = BASE_URL + '/'
setVh()
resetVhAndPx()
})
})
</script>