問(wèn)題和解決原理:部分安卓手機(jī)在調(diào)起手機(jī)軟鍵盤時(shí)种樱,會(huì)頂起底部固定定位元素蒙袍。onresize 事件會(huì)在窗口被調(diào)整大小時(shí)發(fā)生,以此來(lái)監(jiān)聽窗口變化將底部固定定位元素做顯隱處理嫩挤。
<template>
????<div?class="fixed-div"?v-show="showBtn"></div>
??</template>
<script>
??export?default?{
????data(){
??????return{
????????showBtn:?true,
????????clientHeight:document.documentElement.clientHeight
??????}
????},
????mounted()?{
??????window.onresize=?()=>{
????????if(this.clientHeight>document.documentElement.clientHeight)?{
??????????this.showBtn?=false
????????}else{
??????????this.showBtn?=?true
????????}
??????};
????},
??}
??</script>