...
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
@layout BlogLayout
|
||||
@page "/ListBlog"
|
||||
@page "/ListBlog/{Tag}"
|
||||
@page "/SearchBlog/{itemSearch}"
|
||||
@inject NavigationManager Navigation
|
||||
<PageTitle>دانشنامه</PageTitle>
|
||||
<main>
|
||||
@@ -102,6 +103,8 @@
|
||||
[Parameter]
|
||||
public string? Tag { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public string? itemSearch { get; set; }
|
||||
[Parameter,SupplyParameterFromQuery]
|
||||
public int? PageIndex { get; set; }
|
||||
|
||||
@@ -111,7 +114,9 @@
|
||||
{
|
||||
if (PageIndex == null) PageIndex = 1;
|
||||
string url = $"Base/LastBlog?PageIndex={PageIndex ?? 1}&PageSize=6";
|
||||
if (!string.IsNullOrEmpty(Tag)) url += $" &Tag={Tag}";
|
||||
|
||||
if (!string.IsNullOrEmpty(itemSearch)) url += $" &ItemSearch={itemSearch}";
|
||||
else if (!string.IsNullOrEmpty(Tag)) url += $" &Tag={Tag}";
|
||||
request = await _hc.GetFromJsonAsync<PagingDto<BlogDto>>(url);
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user