2020-04-24 18:32:50 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-03-08 22:32:30 +08:00
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign
|
2020-03-08 22:32:30 +08:00
|
|
|
|
{
|
2020-05-22 00:05:26 +08:00
|
|
|
|
public partial class Breadcrumb : AntDomComponentBase
|
2020-03-08 22:32:30 +08:00
|
|
|
|
{
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
|
2020-04-23 17:13:56 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public bool AutoGenerate { get; set; } = false;
|
2020-03-08 22:32:30 +08:00
|
|
|
|
|
2020-04-23 17:13:56 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public string Separator { get; set; } = "/";
|
2020-03-08 22:32:30 +08:00
|
|
|
|
|
2020-04-23 17:13:56 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public string RouteLabel { get; set; } = "breadcrumb";
|
2020-03-08 22:32:30 +08:00
|
|
|
|
|
|
|
|
|
[Inject]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public NavigationManager NavigationManager { get; set; }
|
2020-03-08 22:32:30 +08:00
|
|
|
|
|
2020-04-24 18:32:50 +08:00
|
|
|
|
private readonly BreadcrumbOption[] _breadcrumbs = Array.Empty<BreadcrumbOption>();
|
2020-03-08 22:32:30 +08:00
|
|
|
|
|
2020-04-24 18:32:50 +08:00
|
|
|
|
private void Navigate(string url)
|
2020-03-08 22:32:30 +08:00
|
|
|
|
{
|
2020-04-23 17:13:56 +08:00
|
|
|
|
NavigationManager.NavigateTo(url);
|
2020-03-08 22:32:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
2021-03-12 17:02:11 +08:00
|
|
|
|
string prefixCls = "ant-breadcrumb";
|
|
|
|
|
|
|
|
|
|
this.ClassMapper
|
|
|
|
|
.Add(prefixCls)
|
|
|
|
|
.If($"{prefixCls}-rtl", () => RTL);
|
2020-03-08 22:32:30 +08:00
|
|
|
|
|
|
|
|
|
base.OnInitialized();
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-23 17:13:56 +08:00
|
|
|
|
private void RegisterRouterChange()
|
2020-03-08 22:32:30 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-24 18:32:50 +08:00
|
|
|
|
public class BreadcrumbOption
|
2020-03-08 22:32:30 +08:00
|
|
|
|
{
|
|
|
|
|
public string Label { get; set; }
|
|
|
|
|
|
|
|
|
|
public Dictionary<string, object> Params { get; set; }
|
|
|
|
|
|
2020-04-24 18:32:50 +08:00
|
|
|
|
public Uri Url { get; set; }
|
2020-03-08 22:32:30 +08:00
|
|
|
|
}
|
2020-04-23 17:13:56 +08:00
|
|
|
|
}
|