angular - 显示额外页面的 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 - 如何模拟一个类,它是Angular Jasmine中其他类的扩展
- python - 如何运行脚本但仅打印第一次 1 分钟后和每次 3 分钟后获得的输出,直到脚本运行?(Python)
- python - 根据另一列中的值选择列的值,然后在熊猫数据框中的每一行应用该值
- angular - jsPDF 通过 doc.fromHTML 从 html 读取格鲁吉亚字符
- c# - 从 blazor Asp.net Core 中的另一个组件调用不同的组件方法
- amazon-web-services - 编译 AWS FreeRTOS 项目时出现 CMake 错误
- pdfbox - PDFBOX垂直文本位置与RotationMagic
- python - C++中Python的介绍和xstring中的错误
- angular - Nx monorepo - 指向环境变量的缓存目录
- python - pandas 不是附加值,而是附加一列 NaN。为什么?