This commit is contained in:
Zy
2026-04-06 14:45:50 +08:00
commit f414026af8
373 changed files with 30667 additions and 0 deletions

12
src/utils/rem.ts Normal file
View File

@@ -0,0 +1,12 @@
// 设计稿 1920px
const baseWidth = 1920;
const baseFontSize = 16;
function setRem() {
const scale = document.documentElement.clientWidth / baseWidth;
const fontSize = baseFontSize * scale;
document.documentElement.style.fontSize = fontSize + 'px';
}
window.addEventListener('resize', setRem);
setRem();