计算机系统应用教程网站

网站首页 > 技术文章 正文

img标签渲染base64格式的图片

btikc 2024-10-16 08:17:36 技术文章 10 ℃ 0 评论

后台给的base64格式的图片如下

iVBORw0KGgoAAAANSUhEUgAAAKAAAAA8CAYAAADha7EVAAAIk0lEQVR42u3c+28URRwAcH72H8BoIMYQEohBKmJIGzCRWgFBAtTSFCkgQtFSWgrytKFQKJRHaUtp6QPaXh94fd6z5Wl4CWiBEogUlJdWkKAmBgUrr3G/i3v2lp3Zve7MPnrzwzfc3c7uHddPZub7ndnrh1paEA8eZkU//iXw4AB5cIA8eNgS4NH+9SEH/+J56AKoFxPHyKPXAGmj4Qg5QNOxcIQcIO8BefA5IA8OkGfBPHgdkAcHiO7V16MXpyXoCpYffM/wX9Du1++IURFx23Jf7P2mFvRObquukF8z5aULqtFnAB4oLLI0wMoRtwMAq0ZaD+CpWjcVgKHishtILMC8rGxLA6wZdSsAsPndG5b7YmsqvLoB0gBkdYhYgHMXL7M0wNbJ3wcAHoy7ZLkvNrPER30I1gvRVgCHz5xrGYDHZl1E33x6Dv1Z+f8f5VD8pQDAo8Jx6fXuOi86u6hdPMfML/bDAr+lAFoVoSLAvxoadOOjBbC7ziMmGQANEo/jsy+IEI9/fCEAsCOtHT10esR/YT4oJSZwLtNE6Pf+Yshff9Ds0o2PBUArIuzHKgGhBfC7lacC0Hpmva5x1wLP26ZcCZoTSgHnGgFP/pxGAsIKoNUQKgLMz9qIRZWZkWnoB/RMuPocLK3hHn+NGUDSa7UVHiyq4t1e01FYHiApAfEXFBr6AR9U+9CN7GPobMoZcd5XG9mFBQe9ILRpTz4nngPnGoFPfoyUgByr9VgChFUQKgKMICQgt2pqTf3AjxvcaH/sZcXeDhIQ1u+vBeD0fHwCcrfBZTiGI444FNU5iWlQA/igoRGLb2jCHFPxATDvxB+wPWBzzHX0d63PNIAQZXcHYPFNyW81tDcCeBDw2DYASQkIDM1m4YPhtGnsjSBwpxd0oNNJHUGvNY69ie5X+03BB5F1PgYLEIZm1gA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3KJdiThSXiEVqowrRVgV4qIa8CtLq8ChC6qhziUVq3HmXnW5NGxNYIWGNOwAQ5nmwt4+EEHozaSXkTt1esf4HWS6u/ftJC5mWYFgAxOFTQwjzvJgC8maEqMTywJb83xpdYv0Pslxc+4U7fejqk3bNO2OUNqJaGd9zWfDWtRssvxnBqgAh0r5KoroWvK/rpGr2TBsibke1IQAhm1XbdKo1MoR5Ias1YDMB4jJieA2yWbVNp1qjUJgXQu/XG4C9wWQkOmIdEJbjXpsxRxe+hJR09EildGNFgGr4tNyYDstxU3VuSl1R7EOPBcx6AeIwKoWlbsvsrKgilmVIAdn0Q0b41AAu6WpSDRoApXa4n+a4LiAklWVIAdk09KRwHWn+J0EMqx+o/MPpFMsrpAy3ZwDYZiGTZv2B5QC14lJqLz8nVICkuNf4rLwSrREegD1cE3zTelgDlAKyXbjjDW7JhF/MGvAfSFghgQ2nqctWiTupnxj0geW9nd4huOd1aAKUArLdhkqPeEum+ItZW5/9agKskMzf6Uc5ZV5xJ/VThXP7EsBhM4Yohu1+IxqwyXsuGnNAuCYLgKGsB+Pa2hVgT2jMNyMYEbihllYSonUo1wMwFIShAhyc0IgNM+AZuhvGKIAs9wMCLCMAakEYCj4tyIyCqBWe7QD2hMESoPy9zAZIGxVLiKHisw1A0pyPVRGahJAGQAmZHJrSazhIet6bBcKwAcjqrjijAcrRaZ0b0sJDGyEHaMAwTBuf2WjMRmhbgKyCA+RZMAdoMBiWSUmfqQMaiTCc8PW8buStIcQI+5UQIxCSVkT6IsBQgNGA2CdXQlhcX47NiviiLw7EhlZ8vcEth+gY9oFi9DmALHtCpWv2vC3T7P+zHIgaMtJxpZ4sFIASMLgGCZoWjP8C138vun+FbeoAAAAASUVORK5CYII=

看好了,就是拼接一个'data:image/jpg;base64,'+就可以了。

<img :src="'data:image/jpg;base64,'+captchaURL" alt="验证码" />

扩展

data:,文本数据

data:text/plain,文本数据

data:text/html,HTML代码

data:text/html;base64,base64编码的HTML代码

data:text/css,CSS代码

data:text/css;base64,base64编码的CSS代码

data:text/javascript,Javascript代码

data:text/javascript;base64,base64编码的Javascript代码

data:image/gif;base64,base64编码的gif图片数据

data:image/png;base64,base64编码的png图片数据

data:image/jpeg;base64,base64编码的jpeg图片数据

data:image/x-icon;base64,base64编码的icon图片数据

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表