参考资料: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>
查看更多关于当react 项目使用px2rem的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did222575