refactor: Table 组件 ShowPagination 默认值改为 true

This commit is contained in:
Argo Zhang 2020-02-04 14:16:01 +08:00
parent a34d621f42
commit 35fb697651
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
3 changed files with 16 additions and 12 deletions

View File

@ -141,7 +141,7 @@ namespace Bootstrap.Admin.Pages.Components
/// 获得/设置 是否分页组件 默认为 false
/// </summary>
[Parameter]
public bool ShowPagination { get; set; }
public bool ShowPagination { get; set; } = true;
/// <summary>
/// 获得/设置 是否显示工具栏 默认为 true

View File

@ -6,7 +6,7 @@
查询结果
</div>
<div class="card-body">
<Table @ref="Table" Id="@Id" FixedHeader="@FixedHeader" ShowToolBar="true" ShowExtendButtons="true" ShowRefresh="true" ShowSearch="true" ShowLineNo="true" ShowCheckbox="true" ShowDefaultButtons="true" ShowPagination="true" QueryModel="QueryModel" TItem="TItem" SubmitModalTitle="@SubmitModalTitle" OnQuery="QueryData" OnAdd="OnAdd" OnDelete="OnDelete" OnSave="OnSave" OnResetSearch="OnResetSearch">
<Table @ref="Table" Id="@Id" FixedHeader="@FixedHeader" ShowToolBar="true" ShowExtendButtons="true" ShowRefresh="true" ShowSearch="true" ShowCheckbox="true" ShowDefaultButtons="true" QueryModel="QueryModel" TItem="TItem" SubmitModalTitle="@SubmitModalTitle" OnQuery="QueryData" OnAdd="OnAdd" OnDelete="OnDelete" OnSave="OnSave" OnResetSearch="OnResetSearch">
<TableToolbarTemplate>
@TableToolbarTemplate
</TableToolbarTemplate>

View File

@ -3,17 +3,21 @@
<CascadingValue Value="this">
<nav class="nav align-items-center" aria-label="分页组件">
<div class="pagination-bar">
显示第 <span>@((PageIndex - 1) * PageItems + 1)</span> 到第 <span>@(Math.Min(PageIndex * PageItems, TotalCount))</span> 条记录,总共 <span>@TotalCount</span> 条记录 每页显示
<div class="btn-group dropup">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">@PageItems</button>
<div class="dropdown-menu">
@foreach (var page in GetPages())
{
<div class="@(PageItems == page ? "dropdown-item active" : "dropdown-item")" @onclick="@(e => ClickItem(page))">@(page.ToString())</div>
}
显示第 <span>@((PageIndex - 1) * PageItems + 1)</span> 到第 <span>@(Math.Min(PageIndex * PageItems, TotalCount))</span> 条记录,总共 <span>@TotalCount</span> 条记录
@if(PageCount > 1)
{
<span>每页显示</span>
<div class="btn-group dropup">
<button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">@PageItems</button>
<div class="dropdown-menu">
@foreach (var page in GetPages())
{
<div class="@(PageItems == page ? "dropdown-item active" : "dropdown-item")" @onclick="@(e => ClickItem(page))">@(page.ToString())</div>
}
</div>
</div>
</div>
条记录
<span>条记录</span>
}
</div>
<ul class="@(PageCount > 1 ? "pagination" : "pagination d-none")">
<li class="page-item" @onclick="MovePrev"><div class="page-link" aria-label="上一页"><i class="fa fa-angle-double-left"></i></div></li>