vue 中使用 rem 佈局的兩種方法

在使用 vue-cli 開發 H5 項目時,需要進行 rem 適配,下面提供兩種常用的方法(以 750 設計稿爲例),希望對大家有所幫助。 方法一:在 index.html 或者 main.js 中添加以下代碼: const setHtmlFontSize = () => { const htmlDom = document.getElementsByTagName('html')[0];
相關文章
相關標籤/搜索