如果引用的图片来自线上,直接赋值即可:
<img src="https://baidu.com/xxx.jpg">
如果是静态赋值,写法上略有不同:
<img th:src="@{../img/001.jpg}">
如果是动态赋值,前端代码
<img src="" id="weather-icon">
js代码:
$("#weather-icon").attr("src","/weatherforecast/assets/weatherIcon/100.png");
如果引用的图片来自线上,直接赋值即可:
<img src="https://baidu.com/xxx.jpg">
如果是静态赋值,写法上略有不同:
<img th:src="@{../img/001.jpg}">
如果是动态赋值,前端代码
<img src="" id="weather-icon">
js代码:
$("#weather-icon").attr("src","/weatherforecast/assets/weatherIcon/100.png");