监听window.onload: mounted(){ window.onload=function(){ console.log(document.documentElement.offsetHeight) } }
试试在mounted生命周期函数里面获取。