Upgrade Nuget
大石头 authored at 2024-11-20 14:22:34
948.00 B
YuQue
@model NewLife.YuqueWeb.Models.PageModel
@{
    var pager = Model.Page;
    var url = Model.Url;
}
@if (pager.PageCount > 1)
{
    <nav aria-label="Page navigation">
        <ul class="pagination">
            <li>
                <a href="#" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            @for (int i = 1; i <= pager.PageCount; i++)
            {
                if (i == pager.PageIndex)
                {
                    <li class="disabled">
                        <span>@i</span>
                    </li>
                }
                else
                {
                    <li><a href="@Model.GetUrl(i)">@i</a></li>
                }
            }
            <li>
                <a href="#" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
}