Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于移动端计算图片宽度问题 #115

Open
IceSakuraAzure opened this issue Mar 25, 2022 · 0 comments
Open

关于移动端计算图片宽度问题 #115

IceSakuraAzure opened this issue Mar 25, 2022 · 0 comments

Comments

@IceSakuraAzure
Copy link

代码中计算是这样的
imgWidth_c() { // 对于移动端重新计算图片宽度`
return this.isMobile ? window.innerWidth / 2 - this.mobileGap : this.imgWidth},

这里使用innerWidth,等于完全忽略了父容器宽度,会导致图片大小异常,溢出父容器,建议这里使用容器宽度而不是window.innerWidth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant