首页 > 解决方案 > 显示额外页面的 ngx 分页

问题描述

这段代码显示了一个额外的页面,我该如何解决这个问题?

 <div class="pagination-content-num">
        <div class="row">
            <pagination-template directionLinks="true" autoHide="true" [maxSize]='maxsize' #p="paginationApi"
                id="{{config.id}}" (pageChange)="config.currentPage = $event">
                <div class="custom-pagination">
                    <div class="pagination-previous" [class.disabled]="p.isFirstPage()">
                        <a (click)="p.previous()">
                            <svg xmlns="http://www.w3.org/2000/svg" class="left-arrow" viewBox="0 0 24 24"
                                aria-hidden="true" focusable="false">
                                <path
                                    d="M6.7 11.3L6 12l.7.7 4 4c.4.4 1 .4 1.4 0 .4-.4.4-1 0-1.4L9.8 13H17c.6 0 1-.4 1-1s-.4-1-1-1H9.8l2.3-2.3c.2-.2.3-.4.3-.7 0-.6-.4-1-1-1-.3 0-.5.1-.7.3l-4 4z">
                                </path>
                            </svg> </a>
                    </div>
                    <div *ngFor="let page of p.pages" [class.current]="p.getCurrent() === page.value"
                        (click)="p.setCurrent(page.value)">
                        <a *ngIf="p.getCurrent() !== page.value">
                            <span>{{ page.label }}</span>
                        </a>
                        <div *ngIf="p.getCurrent() === page.value">
                            <span>{{ page.label }}</span>
                        </div>
                    </div>
                    <div class="pagination-next" [class.disabled]="p.isLastPage()" aria-current="page">
                        <a (click)="p.next()"> <svg class="right-arrow" xmlns="http://www.w3.org/2000/svg"
                                viewBox="0 0 24 24" aria-hidden="true" focusable="false">
                                <path
                                    d="M17.3 12.7l.7-.7-.7-.7-4-4c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l2.3 2.3H7c-.6 0-1 .4-1 1s.4 1 1 1h7.2l-2.3 2.3c-.2.2-.3.4-.3.7 0 .6.4 1 1 1 .3 0 .5-.1.7-.3l4-4z">
                                </path>
                            </svg> </a>
                    </div>
                </div>
            </pagination-template>
        </div>
    </div>

我想在我的代码中添加分页但这是我面临的问题我想禁用最后一个按钮并删除额外的页面我该怎么做?

标签: angular

解决方案


推荐阅读