首页 > 解决方案 > 在百里香迭代中使用标签

问题描述

标签: javahtmlthymeleaf

解决方案


我猜你需要使用 th:href 标签:

<div class="col-12 col-md-6" th:each="ApplicationVO: ${ApplicationList}"> 
          <a class="service-link shadow" title="MMIS" th:href="@{${ApplicationVO.applicationLink}}" target="_blank"><span th:text="${ApplicationVO.applicationName} +'&raquo'"></span></a>
</div>

我认为您也可以像这样删除 span 标签:

<div class="col-12 col-md-6" th:each="ApplicationVO: ${ApplicationList}"> 
          <a class="service-link shadow" title="MMIS" th:text="${ApplicationVO.applicationName} +'&raquo'" th:href="@{${ApplicationVO.applicationLink}}" target="_blank"></a>
</div>

推荐阅读