elementui table表格动态高度设置

data:{tableHeight:""}

beforMount(){

let bodyHeight=document.documentElement,clienHeight||document.body.clientHeight;

}

mounted(){

const that=this;

window.onresize=()=>{

    return(()=>{

       window.bodyHeight=document.documentElement,clienHeight||document.body.clientHeight;

       that.tableHeight=window.bodyHeight-490;

    })

}

 

}

onresize函数只有当屏幕大小发生改变时才会触发;

posted @ 2020-09-06 20:38  努力~努力再努力~  阅读(4137)  评论(0编辑  收藏  举报