think-pagination-custom
pagination for ThinkJS 3, if you want to use in ThinkJS 2.x, please view README_v2
install
npm install think-pagination-custom
how to use
controller
const pagination = ; moduleexports = Controller async { const data = await this; const html = ; this; }
view
ejs
{%-pagination%}
nunjucks
{{pagination | safe}}
API
pagination(pagerData, ctx, options)
pagerData
get from by model.countSelectctx
ctx objectoptions
options
options
:
desc: false //show description pageNum: 2 url: '' //page url, when not set, it will auto generated pathname: '' // replace first url to pathname class: '' //pagenation extra class text: next: 'Next' prev: 'Prev' total: 'count: __COUNT__ , pages: __PAGE__'