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

图片预览偶尔会出现白色背景问题 #11160

Closed
yanghong-web opened this issue Oct 21, 2022 · 1 comment
Closed

图片预览偶尔会出现白色背景问题 #11160

yanghong-web opened this issue Oct 21, 2022 · 1 comment

Comments

@yanghong-web
Copy link

Reproduction Link

null

Vant Version

3.6.0

Describe the Bug

image
image
.van-popup类名的样式会覆盖.van-image-preview的样式

Reproduce Steps

并不能完全复现,直接使用ImagePreview函数生成预览可能是白色背景。图片上传组件预览会是黑色背景,然后ImagePreview函数生成预览也会变成黑色

Device / Browser

Chrome/106.0.0.0

@chenjiahan
Copy link
Member

这个是 CSS 顺序的问题,默认情况下,Vant 内的 CSS 是按照 Vant 声明的顺序来引入的,不会出现上述问题。

如果项目打包时使用的打包工具错误处理了 CSS 顺序,就可能出现 Popup 样式覆盖其他组件的情况,建议检查下打包工具的配置和版本,如果在使用 vite,可以参考 #11049

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

No branches or pull requests

2 participants