常用th标签都有那些?
关键字 功能介绍 案例
th:id 替换id
th:text 文本替换
description
th:utext 支持html的文本替换
conten
th:object 替换对象
th:value 属性赋值
th:with 变量赋值运算
th:style 设置样式 th:style="‘display:’ + @{( KaTeX parse error: Expected 'EOF', got '}' at position 36: …'inline-block')}̲ + ''" th:oncli…{users}">
th:if 判断条件
th:unless 和th:if判断相反 <a th:href="@{/login}" th:unless= s e s s i o n . u s e r ! = n u l l > L o g i n < / a > t h : h r e f 链 接 地 址 < a t h : h r e f = " @ / l o g i n " t h : u n l e s s = {session.user != null}>Login</a> th:href 链接地址 <a th:href="@{/login}" th:unless= session.user!=null>Login</a>th:href链接地址 <ath:href="@/login"th:unless={session.user != null}>Login />
th:switch 多路选择 配合th:case 使用
th:case th:switch的一个分支
User is an administrator
th:fragment 布局标签,定义一个代码片段,方便其它地方引用
th:include 布局标签,替换内容到引入的文件 />
th:replace 布局标签,替换整个标签到引入的文件
th:selected selected选择框 选中 th:selected="(${xxx.id} == ${configObj.dd})"
th:src 图片类地址引入
th:inline 定义js脚本可以使用变量