WEB*_*TER 0 javascript thymeleaf
)有没有办法在“script”标签内使用“th:block”标签?像这样的东西:
<script type="text/javascript">
<th:block>
var test = 1;
</th:block>
</script>
Run Code Online (Sandbox Code Playgroud)
你应该使用 attribute th:inline="javascript",然后你可以使用 ath:block但不能在标签中使用,你必须使用如下语法:
<script th:inline="javascript">
[#th:block th:each="item : ${items}"]
- [#th:block th:utext="${item}" /]
[/th:block]
</script>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5728 次 |
| 最近记录: |