1. 前提
样式都使用 rem 定义大小,不能使用 px ,设计稿的 font-size 为 100px
2. 实现
在 public/index.html 文件中
<script>
var width = document.documentElement.clientWidth || document.body.clientWidth;
var ratio = width / 375; // 相对于设计稿的比率
var fontSize = 100 * ratio; // 需要设置的字体大小
document.getElementsByTagName('html')[0].style['font-size'] = fontSize + 'px';
</script>