1.在html头部使用 thymeleaf
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
2.在script标签中添加如下代码: th:inline="javascript"
注意:在js中使用thymeleaf标签时必须将thymeleaf标签放在[[]]之中。如下代码:
<script th:inline="javascript">
Win10.onReady(function () {
//设置壁纸
Win10.setBgUrl({
main: [[@{/frame/win10ui/img/wallpapers/main.jpg}]],
mobile: [[@{/frame/win10ui/img/wallpapers/mobile.jpg}]],
});
Win10.setAnimated([
'animated flip',
'animated bounceIn',
], 0.01);
});
</script>