react-weui icon indicating copy to clipboard operation
react-weui copied to clipboard

Gallery组件,当上传图片名中含有(),空格等特俗字符时,图片预览无法正常显示(是黑的)

Open weinibear opened this issue 4 years ago • 0 comments

当上传图片名中含有(),空格等特俗字符时,如图片名123(1).png,123 abc4.png,上传成功后,预览图片,显示不了图片(黑的),看了 Gallery这个组件源码, imgs.map( (img, i) => { const imgStyle = { backgroundImage: url(${img}), backgroundSize: 'contain', backgroundRepeat: 'no-repeat', backgroundPosition: 'center center' };, backgroundImage: url(${img}),这个地方,当Img中含有括号、空格等特俗字符时,backgroundImage属性是解析不成功的

weinibear avatar Jul 15 '20 08:07 weinibear