install:: pip install flask-pagination
use:: from flask_paginate import Pagination
github::
docs:: https://pythonhosted.org/Flask-paginate/
使用
paginate = Pagination(page=page, per_page=limit, total=len(total_page), css_framework='bootstrap')
# return render_template(index.html, paginate=paginate)
{{ paginate.links }}
- page: 显示页数
- per_page: 分页页数,默认为 10
- total: 总页数
- display_msg: 修改展示模版为中文
display_msg='当前显示 {start}-{end} 张总共 {total} 张'