Fork自 GitCode / 1024程序员开源挑战赛(10.23-11.14)
const autoIframeHeight = (that)=>{ that.contentWindow.TimeID = that.contentWindow.setInterval(()=>{ if(that&&that.contentWindow&&that.contentWindow.document&&that.height<that.contentWindow.document.body.scrollHeight){ that.height = that.contentWindow.document.body.scrollHeight }else{ that.contentWindow.clearInterval(that.contentWindow.TimeID) } },100) }