VUE 2.0コンフィギュレーション・レム
まずpostcss-px2rem(Baiduの缶)をインストール https://www.jianshu.com/p/e6476bbc2131を
NPM postcss-px2remをインストール
ビルド/ VUE-loader.config.js追加ファイルを検索します
CONST px2rem =( 'postcss-px2rem'が必要) :postcss 関数(){ リターン [px2rem({remUnit:75 })]。 }
設定ファイル内のindex.htmlを
<スクリプト> document.getElementsByTagName( 'HTML')[0] .style.fontSize =(document.documentElement.clientWidth || document.body .clientWidth) / 10 + 'ピクセル' ; window.addEventListener( "リサイズ"、()=> { document.getElementsByTagName( 'HTML')[0] .style.fontSize =(document.documentElement.clientWidth || 文書 .body.clientWidth) / 10 + 'ピクセル' ; }); </ SCRIPT>
設定VUE 3.0 REM(Baiduの缶)
首長 https://www.jianshu.com/p/94902796f2ad