项目总结

1、判空指针很重要!

2、单元测试很必要,在和前台vue接时才发现一些小错误还存在,比如sql语句的参数没有用逗号分隔,方法中少赋值一个参数等等。

3、Thymeleaf应用汇总:

1)map遍历:

<li th:each="menu:${menuMap}">
    <a th:href="${menu.key.url}" th:text="${menu.key.name}"></a>
    <ul>
        <li th:each="child, childStat:${menu.value}">
            <a th:href="${child.url}" th:text="${child.name}"></a>
        </li>
    </ul>
</li>

2)list遍历:

<li th:each="page,pageStat:${pageInfo.list}">
    <a th:title="${page.name}" th:href="${page.url}+'?id='+${page.id}+'&cur='+${cur}" target="_blank">
        <div class="news-title" th:utext="${page.name}"></div>
        <p th:text="${page.summary}"></p>

    <span th:text="${page.newsdate}"></span>
    </a>
</li>

3)链接加参数,所有的链接都应该使用@{}方式,包括img的src和a的href

<p>当前 <span th:text="${pageInfo.pageNum}"></span> 页,
    总 <span th:text="${pageInfo.pages}"></span> 页,
    共 <span th:text="${pageInfo.total}"></span> 条记录</p>
<a th:href="@{${which}(cur=${cur})}">首页</a>
<a th:href="@{${which}(cur=${cur},pageNum=${pageInfo.hasPreviousPage}?${pageInfo.prePage}:1)}">上一页</a>
<a th:href="@{${which}(cur=${cur},pageNum=${pageInfo.hasNextPage}?${pageInfo.nextPage}:${pageInfo.pages})}">下一页</a>
<a th:href="@{${which}(cur=${cur},pageNum=${pageInfo.pages})}">尾页</a>

4)通过style加样式

th:style="'background-color:'+ ${commonSystem.bgColor}+''"

5)引入文件

<div th:replace="footer :: common"></div>

在footer.html中

<div th:fragment="common" class="foot">

<!-- 内容 -->

</div>

 

4、文字滚动插件

liMarquee,当滚动内容所在div宽度过宽时,不能实现无缝滚动,需缩小宽度。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值