Table of Contents

Class SwalOption

Namespace
BootstrapBlazor.Components
Assembly
BootstrapBlazor.dll

SweetAlert Option 配置类

public class SwalOption : PopupOptionBase
Inheritance
SwalOption
Inherited Members
Extension Methods

Constructors

SwalOption()

public SwalOption()

Properties

BodyTemplate

获得/设置 ModalBody 组件

public RenderFragment? BodyTemplate { get; set; }

Property Value

RenderFragment

ButtonTemplate

获得/设置 按钮模板

public RenderFragment? ButtonTemplate { get; set; }

Property Value

RenderFragment

CancelButtonText

获得/设置 取消按钮文字 默认为 取消

public string? CancelButtonText { get; set; }

Property Value

string

Category

获得/设置 提示类型 默认为 Success

public SwalCategory Category { get; set; }

Property Value

SwalCategory

Class

获得/设置 弹窗自定义样式

public string? Class { get; set; }

Property Value

string

CloseButtonIcon

获得/设置 关闭按钮图标 默认 fa-solid fa-xmark

public string? CloseButtonIcon { get; set; }

Property Value

string

CloseButtonText

获得/设置 关闭按钮文字 默认为 关闭

public string? CloseButtonText { get; set; }

Property Value

string

ConfirmButtonIcon

获得/设置 确认按钮图标 默认 fa-solid fa-check

public string? ConfirmButtonIcon { get; set; }

Property Value

string

ConfirmButtonText

获得/设置 确认按钮文字 默认为 确认

public string? ConfirmButtonText { get; set; }

Property Value

string

FooterTemplate

获得/设置 Footer 组件

public RenderFragment? FooterTemplate { get; set; }

Property Value

RenderFragment

IsConfirm

获得/设置 是否为确认弹窗模式 此属性给模态弹窗时使用 默认为 false

public bool IsConfirm { get; set; }

Property Value

bool

OnCloseAsync

获得/设置 关闭弹窗回调方法

public Func<Task>? OnCloseAsync { get; set; }

Property Value

Func<Task>

OnConfirmAsync

获得/设置 点击 Confirm 按钮回调方法 用于模态对话框

public Func<Task>? OnConfirmAsync { get; set; }

Property Value

Func<Task>

ShowClose

获得/设置 是否显示关闭按钮 默认为 true 显示

public bool ShowClose { get; set; }

Property Value

bool

ShowFooter

获得/设置 是否显示 Footer 默认 false 不显示

public bool ShowFooter { get; set; }

Property Value

bool

Title

获得/设置 弹窗标题

public string? Title { get; set; }

Property Value

string

Methods

CloseAsync(bool)

关闭弹窗方法

public Task CloseAsync(bool returnValue = true)

Parameters

returnValue bool

模态弹窗返回值 默认为 true

Returns

Task

ToAttributes()

将参数转换为组件属性方法

public Dictionary<string, object> ToAttributes()

Returns

Dictionary<string, object>