简体   繁体   English

用百里香叶到达JS文件中的图像

[英]Reaching an image inside a JS file with thymeleaf

Inside of a massive JS file which was exported by React... 在React导出的庞大JS文件中...

I have ONE image that is coded this way, the other are data:image/png;base64 我有一个以这种方式编码的图像,另一个是data:image/png;base64

...function(e,a,t){e.exports=t.p+"static/media/logo.png"},...

How can I have thymeleaf find the image inside of my static/media folder? 如何让百里香叶在我的static / media文件夹中找到图像?

I know that thymeleaf works like this <img th:src="@{/resources/images/Picture.png}" /> but this is inside of a javascript file so how would I get it? 我知道thymeleaf的运作方式如下<img th:src="@{/resources/images/Picture.png}" />但这是在javascript文件中,那么我怎么得到它?

我将图像转换为base64,一切都很好。

在base64上转换图像的最佳方法是在百里香叶中使用。可以通过转换base 64来使用图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM