有没有人做过分页,只使用layui的样式

提问 未结
4 343
越王够贱
越王够贱 2017-12-31
悬赏:20飞吻
有没有人做过分页,只使用layui的样式
回帖
  • 朱波
    2017-12-31
    结合pagehelper使用
    1 回复
  • 越王够贱
    2017-12-31
    @朱波 解决了
    	    <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-10">
    <span class="layui-laypage-count">共${total}条</span>
    <c:if test="${count > 1}">
    <a href="<%=basePath %>sucai/all_0_0_${curr-1}/" class="layui-laypage-prev" >上一页</a>
    </c:if>
    <c:if test="${count <= 1}">
    <a href="javascript;" class="layui-laypage-prev layui-disabled" >上一页</a>
    </c:if>
    <c:if test="${count != 1 and curr != 1}">
    <a href="<%=basePath %>sucai/all_0_0_1/" class="layui-laypage-first" data-page="1" title="首页">1</a>
    </c:if>
    <c:if test="${displayStart != 1}">
    <span class="layui-laypage-spr">…</span>
    </c:if>
    <c:forEach begin="${displayStart}" end="${displayEnd}" var="i">
    <c:if test="${curr != i}">
    <a href="<%=basePath %>sucai/all_0_0_${i}/" >${i}</a>
    </c:if>
    <c:if test="${curr == i}">
    <span class="layui-laypage-curr"><em class="layui-laypage-em"></em><em>${i}</em></span>
    </c:if>
    </c:forEach>
    <c:if test="${displayEnd != count and curr!= count }">
    <span class="layui-laypage-spr">…</span>
    <a href="<%=basePath %>sucai/all_0_0_${count}/" class="layui-laypage-last" title="尾页" >${count}</a>
    </c:if>
    <c:if test="${curr != count}">
    <a href="<%=basePath %>sucai/all_0_0_${curr+1}/" class="layui-laypage-next" data-page="7">下一页</a>
    </c:if>
    <c:if test="${curr == count}">
    <a href="javascript:;" class="layui-laypage-next layui-disabled" >下一页</a>
    </c:if>
    <span class="layui-laypage-limits"></span>
    <span class="layui-laypage-skip">跳转到第<input type="text" min="1" value="${curr}" class="layui-input" />页<button type="button" class="layui-laypage-btn">确定</button></span>
    </div>
    0 回复
  • 越王够贱
    2017-12-31
    <c:set var="total" value="${materials.total}"/>
    <c:set var="curr" value="${materials.curr}"/>
    <c:set var="limit" value="${materials.limit}"/>
    <c:set var="count" value="${materials.count}"/>
    <c:set var="displayStart" value="${materials.displayStart}"/>
    <c:set var="displayEnd" value="${materials.displayEnd}"/>
    <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-10">
    <span class="layui-laypage-count">共${total}条</span>
    <c:if test="${count > 1}">
    <a href="<%=basePath %>sucai/all_0_0_${curr-1}/" class="layui-laypage-prev" >上一页</a>
    </c:if>
    <c:if test="${count <= 1}">
    <a href="javascript;" class="layui-laypage-prev layui-disabled" >上一页</a>
    </c:if>
    <c:if test="${count != 1 and curr != 1}">
    <a href="<%=basePath %>sucai/all_0_0_1/" class="layui-laypage-first" data-page="1" title="首页">1</a>
    </c:if>
    <c:if test="${displayStart != 1}">
    <span class="layui-laypage-spr">…</span>
    </c:if>
    <c:forEach begin="${displayStart}" end="${displayEnd}" var="i">
    <c:if test="${curr != i}">
    <a href="<%=basePath %>sucai/all_0_0_${i}/" >${i}</a>
    </c:if>
    <c:if test="${curr == i}">
    <span class="layui-laypage-curr"><em class="layui-laypage-em"></em><em>${i}</em></span>
    </c:if>
    </c:forEach>
    <c:if test="${displayEnd != count and curr!= count }">
    <span class="layui-laypage-spr">…</span>
    <a href="<%=basePath %>sucai/all_0_0_${count}/" class="layui-laypage-last" title="尾页" >${count}</a>
    </c:if>
    <c:if test="${curr != count}">
    <a href="<%=basePath %>sucai/all_0_0_${curr+1}/" class="layui-laypage-next" data-page="7">下一页</a>
    </c:if>
    <c:if test="${curr == count}">
    <a href="javascript:;" class="layui-laypage-next layui-disabled" >下一页</a>
    </c:if>
    <span class="layui-laypage-limits"></span>
    <span class="layui-laypage-skip">跳转到第<input type="text" min="1" value="${curr}" class="layui-input" />页<button type="button" class="layui-laypage-btn">确定</button></span>
    </div>
    0 回复
  • 你这看上去挺复杂的 我分页完全就是用layui的样式 就是编写好json格式嘛
    0 回复
本帖已设置禁止回复
本周热议
没有相关数据
layui

微信扫码关注 layui 公众号