mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
d2e9c4b247
* feat(module: config-provider): support RTL * add rtl for each component * fix rtl for pagination * add rtl for overlay
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class Breadcrumb : AntDomComponentBase
|
|
{
|
|
[Parameter]
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
[Parameter]
|
|
public bool AutoGenerate { get; set; } = false;
|
|
|
|
[Parameter]
|
|
public string Separator { get; set; } = "/";
|
|
|
|
[Parameter]
|
|
public string RouteLabel { get; set; } = "breadcrumb";
|
|
|
|
[Inject]
|
|
public NavigationManager NavigationManager { get; set; }
|
|
|
|
private readonly BreadcrumbOption[] _breadcrumbs = Array.Empty<BreadcrumbOption>();
|
|
|
|
private void Navigate(string url)
|
|
{
|
|
NavigationManager.NavigateTo(url);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
string prefixCls = "ant-breadcrumb";
|
|
|
|
this.ClassMapper
|
|
.Add(prefixCls)
|
|
.If($"{prefixCls}-rtl", () => RTL);
|
|
|
|
base.OnInitialized();
|
|
}
|
|
|
|
private void RegisterRouterChange()
|
|
{
|
|
}
|
|
}
|
|
|
|
public class BreadcrumbOption
|
|
{
|
|
public string Label { get; set; }
|
|
|
|
public Dictionary<string, object> Params { get; set; }
|
|
|
|
public Uri Url { get; set; }
|
|
}
|
|
}
|