refactor: 移除组件使用 BB 包
This commit is contained in:
parent
359a01e7ea
commit
8b3ac481e9
|
@ -1,19 +0,0 @@
|
|||
@inherits TooltipComponentBase
|
||||
|
||||
<a @attributes="AdditionalAttributes" id="@Id" href="@Url" @onclick:preventDefault="@Prevent" @onclick="OnClick">
|
||||
@if (!string.IsNullOrEmpty(Text))
|
||||
{
|
||||
@Text
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(Img))
|
||||
{
|
||||
<img alt="img" src="@Img" />
|
||||
}
|
||||
@ChildContent
|
||||
@if (!string.IsNullOrEmpty(Title))
|
||||
{
|
||||
<CascadingValue Value="this" IsFixed="true">
|
||||
<Tooltip Title="@Title" Placement="TooltipPlacement" />
|
||||
</CascadingValue>
|
||||
}
|
||||
</a>
|
|
@ -1,54 +0,0 @@
|
|||
using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
namespace BootstrapAdmin.Web.Components
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public partial class LinkButton
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string? Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string Url { get; set; } = "#";
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string? Title { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string? Img { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Placement TooltipPlacement { get; set; } = Placement.Top;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public RenderFragment? ChildContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<MouseEventArgs> OnClick { get; set; }
|
||||
|
||||
private bool Prevent => Url.StartsWith('#');
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
namespace BootstrapAdmin.Web.Components
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class RedirectToLogin : ComponentBase
|
||||
{
|
||||
[Inject]
|
||||
[NotNull]
|
||||
private NavigationManager? Navigation { get; set; }
|
||||
|
||||
#if DEBUG
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="firstRender"></param>
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
Navigation.NavigateTo($"/Account/Login", true);
|
||||
}
|
||||
#else
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
Navigation.NavigateTo($"/Account/Login", true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
@inherits BootstrapComponentBase
|
||||
|
||||
<a @attributes="AdditionalAttributes" href="#" @onclick:preventDefault @onclick="Toggle">@GetText()</a>
|
|
@ -1,55 +0,0 @@
|
|||
using Microsoft.AspNetCore.Components.Web;
|
||||
|
||||
namespace BootstrapAdmin.Web.Components
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public partial class SwitchButton
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string? OnText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string? OffText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool ToggleState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> ToggleStateChanged { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<MouseEventArgs> OnClick { get; set; }
|
||||
|
||||
private async Task Toggle()
|
||||
{
|
||||
ToggleState = !ToggleState;
|
||||
if (ToggleStateChanged.HasDelegate)
|
||||
{
|
||||
await ToggleStateChanged.InvokeAsync(ToggleState);
|
||||
}
|
||||
if (OnClick.HasDelegate)
|
||||
{
|
||||
await OnClick.InvokeAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private string? GetText() => ToggleState ? OnText : OffText;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue