Skip to content

Commit e654d66

Browse files
authored
feat(Toast): support DialogCloseButton component (#5276)
* feat: 增加 AddStyle 方法 * test: 增加单元测试 * refactor: use AddStyle method * doc: 重构代码 * refactor: 重构代码 * Revert "refactor: 重构代码" This reverts commit 37653dc. * feat: 增加 BootstrapLabelSetting 组件 * feat: 增加 LabelWidth 参数 * feat: 实现 LabelWidth 逻辑 * test: 增加单元测试 * doc: 移除 IsHtml 参数说明 * doc: 更新 Content 说明文档 * feat: 增加级联参数
1 parent c33eb02 commit e654d66

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

src/BootstrapBlazor.Server/Components/Samples/Toasts.razor.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,6 @@ private AttributeItem[] GetAttributes() =>
197197
DefaultValue = "true"
198198
},
199199
new()
200-
{
201-
Name = "IsHtml",
202-
Description = Localizer["ToastsAttrIsHtml"],
203-
Type = "boolean",
204-
ValueList = "",
205-
DefaultValue = "false"
206-
},
207-
new()
208200
{
209201
Name = "Placement",
210202
Description = Localizer["ToastsAttrPlacement"],

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"ToastsHeaderTemplateIntro": "set <code>HeaderTemplate</code> custom the header content",
153153
"ToastsAttrCategory": "Toast type",
154154
"ToastsAttrTitle": "Toast title",
155-
"ToastsAttrContent": "Toast content",
155+
"ToastsAttrContent": "Toast content support HTML",
156156
"ToastsAttrDelay": "Auto hide interval",
157157
"ToastsAttrIsAutoHide": "Whether to automatically hide",
158158
"ToastsAttrIsHtml": "Whether the content contains Html code",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"ToastsHeaderTemplateIntro": "通过设置 <code>HeaderTemplate</code> 自定义标题栏内容",
153153
"ToastsAttrCategory": "Toast 类型",
154154
"ToastsAttrTitle": "Toast 标题",
155-
"ToastsAttrContent": "Toast 内容",
155+
"ToastsAttrContent": "Toast 内容,支持 Html 标签",
156156
"ToastsAttrDelay": "自动关闭时间",
157157
"ToastsAttrIsAutoHide": "是否自动关闭提示框",
158158
"ToastsAttrIsHtml": "内容是否包含 HTML",

src/BootstrapBlazor/Components/Toast/Toast.razor

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
</div>
2525
}
2626
<div class="toast-body">
27-
@if (Options.ChildContent != null)
28-
{
29-
@Options.ChildContent
30-
}
31-
else if (!string.IsNullOrEmpty(Options.Content))
32-
{
33-
@((MarkupString)Options.Content)
34-
}
27+
<CascadingValue Value="Close" IsFixed="true">
28+
@if (Options.ChildContent != null)
29+
{
30+
@Options.ChildContent
31+
}
32+
else if (!string.IsNullOrEmpty(Options.Content))
33+
{
34+
@((MarkupString)Options.Content)
35+
}
36+
</CascadingValue>
3537
</div>
3638
<div class="@ProgressClass"></div>
3739
</div>

0 commit comments

Comments
 (0)