前端窗口自适应大小

  componentDidMount() {

    window.addEventListener("resize",function(){
      if(window.parent.setIfHeight){
        window.parent.setIfHeight($("#children").height());
      }
    });

    $("#root").bind('DOMNodeInserted',function(e){
      if(window.parent.setIfHeight && window.parent.innerHeight < $("#children").height()){
        window.parent.setIfHeight($("#children").height());
      }
    }); 
   
  }

猜你喜欢

转载自blog.csdn.net/qq_28060549/article/details/88051384