2

<button type="button" class="dropdown" th:text="#{Lang.Select}">Please select <i class="icon icon-chevron-down"></i></button>

如何用后端替换“请选择”,并保留<i>带有属性的元素?

4

1 回答 1

4

您必须插入一个额外的跨度,但这将在生成时删除。 <button type="button" class="dropdown"><span th:text="#{Lang.Select}" th:remove="tag">Please select<span> <i class="icon icon-chevron-down"></i></button>

另一种选择是将其放入 th:text,但我更喜欢第一个。 <button type="button" class="dropdown" th:text="${#{Lang.Select} + '<i class="icon icon-chevron-down"></i>'}">Please select <i class="icon icon-chevron-down"></i></button>

于 2013-10-08T16:15:52.283 回答