admin管理员组

文章数量:1123011

I'm trying to use Bootstrap (v5.3) Badges.

When I use the example of docs:

<button type="button" class="btn btn-primary position-relative">
  Inbox
  <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
    99
  </span>
</button>

it works perfectly. But, if I replace the 99 with a thymeleaf portion, that didn't work.

<button type="button" class="btn btn-primary position-relative">
  Inbox
  <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
    ${numberDependents}
  </span>
</button>

I've tried many ways:

${numberDependents}
__${numberDependents}__
[[${numberDependents}]]
<span th:text="${numberDependents}"></span>
<span th:text="|${numberDependents}|"></span>
<span th:text="__${numberDependents}__"></span>
<span th:text="[[${numberDependents}]]"></span>

And no one worked... any suggestions?

本文标签: Thymeleaf don180t work with bootstrap badgesStack Overflow