export function getFontSize(size) { const screenWidth = window.innerWidth; // 获取屏幕宽度 if (screenWidth > 1920) { // 如果屏幕宽度大于等于 1920,字体大小为 16 像素 return 12; } else { // 否则根据屏幕宽度动态计算字体大小 return Math.round(screenWidth / size); } }