using thymeleaf之九属性优先级

来源:互联网 发布:o2o产品用到的算法 编辑:程序博客网 时间:2024/05/14 18:13

9 th:* 属性优先级

我们可以在一个html标签中设置一个或多个th:*属性,有时为了避免冲突,thymeleaf为其设置了属性优先级机制。

优先级由高到低依次为:

OrderFeatureAttributes1Fragment inclusionth:include
th:replace2Fragment iterationth:each3Conditional evaluationth:if
th:unless
th:switch
th:case4Local variable definitionth:object
th:with5General attribute modificationth:attr
th:attrprepend
th:attrappend6Specific attribute modificationth:value, th:href, th:src, etc.7Text (tag body modification)th:text
th:utext8Fragment specificationth:fragment9Fragment removalth:remove

1 0