Thymeleaf <ul> 巢列表迭代

Thymeleaf <ul> nest list iteration

提问人:Rahul Gupta 提问时间:3/27/2023 更新时间:3/27/2023 访问量:19

问:

使用 thymeleaf th:我正在迭代我的列表的每个属性,但除此之外,我还给出了一个按钮来执行操作,但在我的页面上看不到该按钮如何解决这个问题

<ul class="tree">
    <li class="tree-branch-link tree-branch-action" th:each="name:${sectionsName}">
        <span  th:text="${name.sectionName}"><button class="tree-branch-button" onclick="showPremises(this)">+</button>
        </span>
    </li>
</ul>
HTML Thymeleaf 嵌套列表

评论

0赞 andrewJames 3/27/2023
温 你使用的结果替换所有子内容 - 在你的情况下包括标签。重新排列 HTML。在启动 .如果需要,将按钮放在第二个跨度中。或者使用 CSS 设置列表项的格式。th:text="${...}"${...}<button><span><button>

答: 暂无答案