Vue
data:{
isTabbar: true, //判断页面的fixed内容是展示还是隐藏
docmHeight: document.documentElement.clientHeight, //默认屏幕高度
showHeight: document.documentElement.clientHeight, //实时屏幕高度
},
mounted() {
// window.onresize监听页面高度的变化
window.onresize = () => {
return (() => {
this.showHeight = document.documentElement.clientHeight;
})()
}
},
watch: {
showHeight() {
if (this.docmHeight > this.showHeight) {
this.isTabbar = false
} else {
this.isTabbar = true
}
}
},