<v-header ref="headerRef" />
<v-tags ref="tagsRef"></v-tags>

import { ref, reactive, onMounted, watch } from 'vue'

setup() {
let clientHeight = ref('') //浏览器可视区域高度
const headerRef = ref(null)

const tagsRef = ref(null)
let slbHeight = ref('')

onMounted(() => {

clientHeight.value = `${document.documentElement.clientHeight}` //获取浏览器可视区域高度

let headerHeight = headerRef.value.$el.clientHeight

let tagsHeight = tagsRef.value.$el.clientHeight

slbHeight.value = clientHeight.value - headerHeight - tagsHeight

window.onresize = function () {

clientHeight.value = `${document.documentElement.clientHeight}` //获取浏览器可视区域高度

let headerHeight = headerRef.value.$el.clientHeight

let tagsHeight = tagsRef.value.$el.clientHeight

slbHeight.value = clientHeight.value - headerHeight - tagsHeight

}

})



return {

clientHeight,

slbHeight,

headerRef,

tagsRef,

}
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐