当react 项目使用px2rem

参考资料:http://easywork.xin/2018/09/02/react-2/

我拿到的设计图 是  375px

//配置px2rem
px2rem({remUnit: 37.5})
 
在index.html 加以下的script
<script>document.getElementsByTagName('html')[0].style.fontSize = (document.documentElement.clientWidth || document.body.clientWidth) /10 + 'px';</script>
 
原文地址:https://www.cnblogs.com/yigexiaojiangshi/p/10489097.html