feat: Toast 增加 Id 防止多个 toast 时产生错误
This commit is contained in:
parent
a90a478348
commit
74fef7fdc6
|
@ -51,6 +51,12 @@ namespace Bootstrap.Admin.Components
|
|||
[Parameter]
|
||||
public string Text { get; set; } = "Toast 消息正文内容-未设置";
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 组件 ID
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string Id { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 控件呈现后回调方法
|
||||
/// </summary>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
|
||||
<div class="table-wrapper">
|
||||
<table class="table table-striped table-bordered table-hover table-selected">
|
||||
<table class="table table-striped table-bordered table-hover table-selected" id="@Id">
|
||||
<thead>
|
||||
<tr>
|
||||
@if (ShowLineNo)
|
||||
|
@ -87,4 +87,4 @@
|
|||
</ModalBody>
|
||||
</SubmitModal>
|
||||
|
||||
<Toast @ref="Toast"></Toast>
|
||||
<Toast @ref="Toast" Id="@($"{Id}_toast")"></Toast>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@inherits ToastBase
|
||||
|
||||
<div class="toast fade @Placement.ToCss("toast")" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="@(AutoHide ? "true":"false")" data-delay="@Interval">
|
||||
<div class="toast fade @Placement.ToCss("toast")" id="@Id" role="alert" aria-live="assertive" aria-atomic="true" data-autohide="@(AutoHide ? "true":"false")" data-delay="@Interval">
|
||||
<div class="toast-header">
|
||||
<div class="toast-bar"><i class="@RenderCategory()"></i></div>
|
||||
<strong class="mr-auto">@Title</strong>
|
||||
|
|
Loading…
Reference in New Issue