zent
Version:
一套前端设计语言和基于React的实现
19 lines (18 loc) • 511 B
JavaScript
export default function miniLayout(options) {
var current = options.current, pageSize = options.pageSize, total = options.total;
var totalPages = Math.ceil(total / pageSize);
return [
{
type: 'left-arrow',
disabled: current <= 1 || total <= 0,
},
{
type: 'mini-jumper',
totalPages: totalPages,
},
{
type: 'right-arrow',
disabled: current >= totalPages || total <= 0,
},
];
}