uniapp base64数据展示图片
1.‘data:image/png;base64,’ + 获取到的base64数据
1 | this.imgUrl = 'data:image/png;base64,' + res.data.data.img |
2.打印出的转换数据(this.imgUrl)放在浏览器上可以显示,目前此步渲染不到image标签上,这是因为base64字符串太长,在传输过程中加入回车导致
3.解决办法:.replace(/[\r\n]/g, “”)
1 | <image :src='imgUrl.replace(/[\r\n]/g, "")'></image> |
Invitation
aqing
962555446
created:15/04/2021
Welcome to Candyhome
Use this card to join the candyhome and participate in a pleasant discussion together .
Welcome to aqing's candyhome,wish you a nice day .
评论