如何在百里香中做这样的条件算子?
Ex: condiction ? result1 : result2
答案 0 :(得分:1)
<tr th:class="${row.even}? 'even' : 'odd'">
...
</tr>
<tr th:class="${row.even}? (${row.first}? 'first' : 'even') : 'odd'">
...
</tr>
<tr th:class="${row.even}? 'alt'">
...
</tr>