我也尝试了其他几种方法,例如ng-bootstrap。所有元素都具有在li元素之间徘徊的相同问题。仅当我从导航容器中退出并再次返回时,悬停才有效。我已附上我的代码。可以帮我编辑什么内容。
<div class="col" style="text-align: center">
<div class="span8">
<nav id="pagination">
<ul *ngIf="_dataSize != 0 && _pageSizeOptions.length > 0" class="pagination">
<li class="page-item" [ngClass]="{disabled: currentPage === 1}">
<a class="page-link" (click)="setPage(1)">First</a>
</li>
<li class="page-item" [ngClass]="{disabled: currentPage === 1}">
<a class="page-link" (click)="setPage(currentPage - 1)">Previous</a>
</li>
<li class="page-item" *ngFor="let page of pages" [ngClass]="{active: currentPage === page}">
<a class="page-link page" (click)="setPage(page)">{{page}}</a>
</li>
<li class="page-item" [ngClass]="{disabled: currentPage === totalPages}">
<a class="page-link" (click)="setPage(currentPage + 1)">Next</a>
</li>
<li class="page-item" [ngClass]="{disabled: currentPage === totalPages}">
<a class="page-link" (click)="setPage(totalPages)">Last</a>
</li>
</ul>
</nav>
</div>
</div>