相关疑难解决方法(0)

Thymeleaf:添加到现有值而不是替换它们

有没有办法告诉Thymeleaf添加参数到标签而不是覆盖它们?

例:

 <div class="a" th:class=${x ? 'b' : 'c'}>
Run Code Online (Sandbox Code Playgroud)

应该导致

<div class="a b">
Run Code Online (Sandbox Code Playgroud)

要么

<div class="a c">
Run Code Online (Sandbox Code Playgroud)

问候

java spring spring-mvc thymeleaf

3
推荐指数
1
解决办法
441
查看次数

标签 统计

java ×1

spring ×1

spring-mvc ×1

thymeleaf ×1