Web项目实战 | 购物系统v2.0 | 开发记录(三)分页显示 | 根据商品名称进行模糊查询

祝大家2022新年快乐!

历史记录


一、运行环境


  • windows10
  • IDEA 2021.1 专业版
  • JDK8
  • SpringBoot2
  • Druid 1.2.5
  • Bootstrap 4.6.0
  • MySQL 8
  • Navicat 11

二、PagheHelper插件插件实现分页显示

PageHelper插件是基于MyBatis框架实现的,使用原先的pageHelper插件需要有配置文件,而在SpringBoot项目中只要设置起步依赖,配置即用,十分的方便
pom.xml


<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>2.2.1</version>
</dependency>

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>1.4.1</version>
</dependency>

在这里插入图片描述
前端代码:

<!-- 商品列表 -->
<div class="container">
   <ul style="list-style: none" class="row">
       <!--/*@thymesVar id="comInfo" type="java.util.List<com.uni.pojo.Commodity>"*/-->
       <li th:each="com : ${comInfo}" class="col-md-2 col-sm-4 u-card-body text-center">
           <img th:src="${com.comImgSrc}" class="u-card-img">
           <h6 class="u-text-sm text-danger"><span th:text="${com.comPrice}"></span></h6>
           <h6 class="u-text-sm"><span th:text="'[' + ${com.comType} + ']'">
  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值