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

react 动态设置 backgroundImage base64图片不显示bug记录 #26

Open
heboliufengjie opened this issue Jun 8, 2020 · 0 comments
Open

Comments

@heboliufengjie
Copy link
Owner

解决方案

先把base64里面的空格转义
img = img.replace(/\s/g, encodeURIComponent(' '))
1
使用模板字符串设置backgroundImage
$0.style.backgroundImage = url('${img}')
————————————————
版权声明:本文为CSDN博主「wangweiren_get」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/wangweiren_get/java/article/details/101053929

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