首页 > 其他 > 详细

mat-paginatoor控件

时间:2019-08-16 18:59:19      阅读:90      评论:0      收藏:0      [点我收藏+]

技术分享图片

pageNumber是点击搜索查询后,跟新的变量值。

技术分享图片

import { MatPaginatorIntl } from ‘@angular/material‘;

const getRangeLabel = (page: number, pageSize: number, length: number) => {
    if (length === 0 || pageSize === 0) {
        return ‘无数据‘;
    }
    length = Math.max(length, 0);
    const startIndex = page * pageSize;
    const endIndex = startIndex < length ? Math.min(startIndex + pageSize, length) : startIndex + pageSize;
    return ‘第‘ + (startIndex + 1) + ‘ - ‘ + endIndex + ‘条,共 ‘ + length + ‘条‘;
}

export function myPaginator() {
    const p = new MatPaginatorIntl();
    p.itemsPerPageLabel = ‘每页条数‘;
    p.nextPageLabel = ‘下一页‘;
    p.previousPageLabel = ‘上一页‘;
    p.firstPageLabel = ‘第一页‘;
    p.lastPageLabel = ‘最后一页‘;
    p.getRangeLabel = getRangeLabel;
    return p;
}

 

mat-paginatoor控件

原文:https://www.cnblogs.com/lishidefengchen/p/11365308.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!