首页 > 解决方案 > 如何在 Pure js 中使用把手显示来自 api 的图像?base64

问题描述

我正在使用车把模板来显示数据。现在我正在使用 url 检索以显示图像。我不知道如何使用 base64 检索图像。如何使用 base64 进行检索。

{{#each content.files }}
        <img class="mb-4 src="{{this.url}}" />
{{/each}}

标签: javascripthandlebars.js

解决方案


 {{#each content.files}}
        <img class="mb-4 src="data:image/png;base64, {{image}}" />
   {{/each}}

推荐阅读