
thymeleaf
Master_Yoda
Named after the name of God,by your hands!
展开
-
thymeleaf字符串拼接url
如果我们想对a标签里的href属性进行拼接, 拼接成下面这样: http://localhost:8887/profile/questions?page=2 我想questions拼接到里面,由于它不总是questions,所以可以像下面这样拼接 <a th:href="@{'/profile/'+${section}(page=${pagination.totalPage})}" aria...原创 2020-04-15 17:33:39 · 1847 阅读 · 0 评论 -
thymleaf动态添加类
要实现动态添加类需要使用th:classappend标签, <div th:classappend="${error==null} ? 'show-error' :''"></div> 上面这句,如果errror 为null的时候,就会给这个div在原有的class的基础上添加一个show-error的类,如果直接用th:class会直接替换掉它原有的类 ...原创 2020-04-08 15:11:29 · 1379 阅读 · 0 评论 -
thymeleaf基本使用
1 导入命名空间和pom文件里的坐标 <html lang="en" xmlns:th="http://www.thymeleaf.org"> 这样的话,在idea中写代码的时候,就会有thymeleaf的代码提示。 引入thymeleaf的坐标 <dependency> <groupId>org.springframework.b...原创 2019-10-28 22:16:15 · 1343 阅读 · 0 评论