React获取窗口大小

 

 

  const width = window.innerWidth;
  const height = window.innerHeight;

 

posted @ 2022-08-22 11:19  SimoonJia  阅读(79)  评论(0编辑  收藏  举报