setScale() { const designWidth = 2047 // 设计稿的宽度,根据实际项目调整 const designHeight = 1080 // 设计稿的高度,根据实际项目调整 const scale = document.documentElement.clientWidth / document.documentElement.clientHeight < designWidth / designHeight ? (document.documentElement.clientWidth / designWidth) : (document.documentElement.clientHeight / designHeight) document.querySelector('.user-navigation-container').style.transform = `scale(${scale}) translate(-50%)` },
标签:scale,const,documentElement,缩放,designWidth,designHeight,document From: https://www.cnblogs.com/q962286047/p/17593819.html