temple中:
<iframe width="100%" :height="fullHeight" :src="pdfSRC" id="pdf"></iframe>
data()中:
fullHeight: document.documentElement.clientHeight ,
timer: true
watch中:
watch: {
fullHeight(val) {
if (!this.timer) {//防止多次触发监听页面卡顿
this.fullHeight = val;
this.timer = true;
let that = this;
setTimeout(function() {
that.timer = false;
}, 400);
}
}
},
mounted中:
window.onresize = () => {
return (() => {
window.fullHeight = document.documentElement.clientHeight;
this.fullHeight = window.fullHeight ;
})();
};