zoukankan      html  css  js  c++  java
  • thymeleaf中分类信息使用不同的样式

    需求:

    相关class类名:S224_on_point

    url:/notification/list

     url:/notification/list?type=2

    thymeleaf代码如下:

    <div th:classappend="${(param.isEmpty() ? 'S224_on_point ' : '') + 'S224_message_kind pageChange'}" th:attr="data-page=@{/notification/list}">全部消息</div>
                    <div th:classappend="${(#strings.equals(#request.getParameter('type'),'1') ? 'S224_on_point ' : '') + 'S224_message_kind pageChange'}" th:attr="data-page=@{/notification/list(type=1)}">平台动态</div>
                    <div th:classappend="${(#strings.equals(#request.getParameter('type'),'2') ? 'S224_on_point ' : '') + 'S224_message_kind pageChange'}" th:attr="data-page=@{/notification/list(type=2)}">产品消息</div>
                    <div th:classappend="${(#strings.equals(#request.getParameter('type'),'3') ? 'S224_on_point ' : '') + 'S224_message_kind pageChange'}" th:attr="data-page=@{/notification/list(type=3)}">财务消息</div>
                    <div th:classappend="${(#strings.equals(#request.getParameter('type'),'4') ? 'S224_on_point ' : '') + 'S224_message_kind pageChange'}" th:attr="data-page=@{/notification/list(type=4)}">用量消息</div>

    thymeleaf中${param.xx}返回的是数组,这一点和jstl不一样,所以此次使用#request.getParameter('type')

  • 相关阅读:
    【npm】mac下node环境搭建
    pair求解迷宫的最短路径(bfs)
    dos窗口启动关闭Mysql
    二维差分模板
    一维差分模板
    DOS命令
    迷宫搜索dfs实现
    DFS 迷宫问题
    BFS广搜解决迷宫问题(跟着B站大佬手撸)
    蓝桥杯省赛模拟赛
  • 原文地址:https://www.cnblogs.com/passedbylove/p/11820142.html
Copyright © 2011-2022 走看看