Table of Contents

Class ButtonBase

Namespace
BootstrapBlazor.Components
Assembly
BootstrapBlazor.dll

Button 按钮组件

public abstract class ButtonBase : TooltipWrapperBase, IComponent, IHandleAfterRender, IHandleEvent, IAsyncDisposable
Inheritance
ButtonBase
Implements
Derived
Inherited Members
Extension Methods

Constructors

ButtonBase()

protected ButtonBase()

Properties

ButtonIcon

获得/设置 实际按钮渲染图标

protected string? ButtonIcon { get; set; }

Property Value

string

ButtonStyle

获得/设置 按钮风格枚举

[Parameter]
public ButtonStyle ButtonStyle { get; set; }

Property Value

ButtonStyle

ButtonType

获得/设置 按钮类型 Submit 为表单提交按钮 Reset 为表单重置按钮 默认为 Button

[Parameter]
public ButtonType ButtonType { get; set; }

Property Value

ButtonType

ChildContent

获得/设置 RenderFragment 实例

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

ClassName

获得 按钮样式集合

protected string? ClassName { get; }

Property Value

string

Color

获得/设置 按钮颜色

[Parameter]
public virtual Color Color { get; set; }

Property Value

Color

Disabled

获得 按钮 disabled 属性

protected string? Disabled { get; }

Property Value

string

DisabledString

获得 按钮 aria-disabled 属性

protected string DisabledString { get; }

Property Value

string

Icon

获得/设置 显示图标

[Parameter]
public string? Icon { get; set; }

Property Value

string

IconTheme

获得 IconTheme 实例

[Inject]
protected IIconTheme? IconTheme { get; set; }

Property Value

IIconTheme

IsAsync

获得/设置 是否为异步按钮,默认为 false 如果为 true 表示是异步按钮,点击按钮后禁用自身并且等待异步完成,过程中显示 loading 动画

[Parameter]
public bool IsAsync { get; set; }

Property Value

bool

IsAsyncLoading

获得/设置 是否当前正在异步执行操作

protected bool IsAsyncLoading { get; set; }

Property Value

bool

IsBlock

获得/设置 Block 模式

[Parameter]
public bool IsBlock { get; set; }

Property Value

bool

IsDisabled

获得/设置 是否禁用 默认为 false

[Parameter]
public bool IsDisabled { get; set; }

Property Value

bool

IsKeepDisabled

获得/设置 是否异步结束后是否保持禁用状态,默认为 false

[Parameter]
public bool IsKeepDisabled { get; set; }

Property Value

bool

Remarks

IsAsync 开启时有效

IsOutline

获得/设置 Outline 样式 默认 false

[Parameter]
public bool IsOutline { get; set; }

Property Value

bool

LoadingIcon

获得/设置 正在加载动画图标 默认为 fa-solid fa-spin fa-spinner

[Parameter]
public string? LoadingIcon { get; set; }

Property Value

string

OnClick

获得/设置 OnClick 事件

[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }

Property Value

EventCallback<MouseEventArgs>

OnClickWithoutRender

获得/设置 OnClick 事件不刷新父组件

[Parameter]
public Func<Task>? OnClickWithoutRender { get; set; }

Property Value

Func<Task>

Size

获得/设置 Size 大小

[Parameter]
public Size Size { get; set; }

Property Value

Size

StopPropagation

获得/设置 点击时间是否向上传播 默认 false

[Parameter]
public bool StopPropagation { get; set; }

Property Value

bool

Tab

获得 按钮 tab index 属性

protected string? Tab { get; }

Property Value

string

Text

获得/设置 显示文字

[Parameter]
public string? Text { get; set; }

Property Value

string

ValidateForm

获得 ValidateForm 实例

[CascadingParameter]
protected ValidateForm? ValidateForm { get; set; }

Property Value

ValidateForm

Methods

DisposeAsync(bool)

DisposeAsyncCore 方法

protected override ValueTask DisposeAsync(bool disposing)

Parameters

disposing bool

Returns

ValueTask

OnAfterRenderAsync(bool)

OnAfterRenderAsync 方法

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task

OnInitialized()

OnInitialized 方法

protected override void OnInitialized()

OnParametersSet()

OnParametersSet 方法

protected override void OnParametersSet()

RemoveTooltip()

销毁 Tooltip 方法

public virtual Task RemoveTooltip()

Returns

Task

SetDisable(bool)

设置按钮是否可用状态

public void SetDisable(bool disable)

Parameters

disable bool

ShowTooltip()

显示 Tooltip 方法

public virtual Task ShowTooltip()

Returns

Task