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

[Bug Report] van-toast 背景颜色是白色 #13268

Open
chudongvip opened this issue Dec 17, 2024 · 6 comments
Open

[Bug Report] van-toast 背景颜色是白色 #13268

chudongvip opened this issue Dec 17, 2024 · 6 comments

Comments

@chudongvip
Copy link

Reproduction Link

null

Vant Version

4.9.10

Describe the Bug

使用最新版的 vant 库,showFailToast 背景颜色被 van-popup 覆盖了

Reproduce Steps

使用最新版的 vant 库,showFailToast 背景颜色被 van-popup 覆盖了

Device / Browser

chrome

@ccav213
Copy link

ccav213 commented Dec 17, 2024

好像是按需应用导致的,我写了一个简单示例,有时候打开是好的,有时候就是白色背景,项目复杂的时候就一直是白的
1734423894173

@galleonsZcc
Copy link

我也遇到了相同的问题,是按需引用动态加载css导致的,van-toast和van-pop权重是一样的,但是谁后引入谁起作用,导致van-pop的样式覆盖了van-toast

@chudongvip
Copy link
Author

大家按照我下面的更改可以解决这个问题:

// 引入组件样式
import 'vant/lib/index.css'
// 引入toast样式,否则无样式
import 'vant/es/toast/style'

@chudongvip
Copy link
Author

我相信这应该是一个 BUG,van-popup 应该作为基准样式,van-toast 则应该覆盖它

@Deja-vuuu
Copy link

Deja-vuuu commented Dec 23, 2024

同样的问题 version 4.9.15

image

@yyman001
Copy link

明显就是规范错误了, 优先级管理混乱了....

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

5 participants