From 04c55bf74021f0fb26474a2fceb060fb774d46d4 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Fri, 29 Apr 2022 12:53:49 +0800 Subject: [PATCH 1/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20Toast=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/Toasts.razor | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/BootstrapBlazor.Shared/Samples/Toasts.razor b/src/BootstrapBlazor.Shared/Samples/Toasts.razor index f3ace85e2..de9d26711 100644 --- a/src/BootstrapBlazor.Shared/Samples/Toasts.razor +++ b/src/BootstrapBlazor.Shared/Samples/Toasts.razor @@ -6,6 +6,17 @@

提供轻量级 Toast 弹窗

+

组件使用介绍:

+ +

1. 注入服务 ToastService

+
@@inject ToastService ToastService
+
[Inject]
+[NotNull]
+private ToastService? ToastService { get; set; }
+
+

2. 调用其实例 api

+
await ToastService.Success("Title", "Content", autoHide: true);
+
@@ -90,14 +101,6 @@ } - -

- 需要在使用本组件的页面中内置 Toast 组件,或者在 MainLayout 主布局组件中内置,示例代码如下: -

-
- -
<Toast />
- 特别说明: 可以通过 BootstrapBlazorOptions 全局统一配置参数可以设置整个系统内的 Toast 组件 Delay 参数值

通过配置文件 appsetting.json 文件配置,适用于 Server-Side App

-- Gitee From 7998c4e7c5d6a1f0cd038e65f66676138a0c5361 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Fri, 29 Apr 2022 12:58:05 +0800 Subject: [PATCH 2/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20swal=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/SweetAlerts.razor | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/BootstrapBlazor.Shared/Samples/SweetAlerts.razor b/src/BootstrapBlazor.Shared/Samples/SweetAlerts.razor index 7a34d55a6..87521a958 100644 --- a/src/BootstrapBlazor.Shared/Samples/SweetAlerts.razor +++ b/src/BootstrapBlazor.Shared/Samples/SweetAlerts.razor @@ -4,6 +4,24 @@

模态对话框,多用于动作过程中进行询问后继续,或者显示执行结果

+

组件使用介绍:

+ +

1. 注入服务 SwalService

+
@@inject SwalService SwalService
+
[Inject]
+[NotNull]
+private SwalService? SwalService { get; set; }
+
+

2. 调用其实例 api

+
var op = new SwalOption()
+{
+    Category = SwalCategory.Success,
+    Title = "我是 Title",
+    Content = "我是 Content",
+    ShowClose = false
+};
+await SwalService.Show(op);
+
-- Gitee From b84b3525102e1513fc120f51faa6f2fc0e0cf593 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Fri, 29 Apr 2022 13:04:27 +0800 Subject: [PATCH 3/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/Dialogs.razor | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/BootstrapBlazor.Shared/Samples/Dialogs.razor b/src/BootstrapBlazor.Shared/Samples/Dialogs.razor index dafd97533..d7055341b 100644 --- a/src/BootstrapBlazor.Shared/Samples/Dialogs.razor +++ b/src/BootstrapBlazor.Shared/Samples/Dialogs.razor @@ -4,6 +4,27 @@

通过注入服务调用 Show 方法弹出窗口进行人机交互

+

组件使用介绍:

+ +

1. 注入服务 DialogService

+
@@inject DialogService DialogService
+
[Inject]
+[NotNull]
+private DialogService? DialogService { get; set; }
+
+

2. 调用其实例 api

+
var op = new DialogOption()
+{
+    Title = "数据查询窗口",
+    ShowFooter = false,
+    BodyContext = DataPrimaryId
+};
+op.Component = BootstrapDynamicComponent.CreateComponent<DataDialogComponent>(new Dictionary<string, object?>
+{
+    [nameof(DataDialogComponent.OnClose)] = new Action(async () => await op.Dialog.Close())
+});
+await DialogService.Show(op);
+

通过设置 DialogOption IsKeyboard 参数,开启弹窗是否支持 ESC,请点击后面按钮设置后再点击 弹窗 按钮测试效果

-- Gitee From a71d1be9fab6ca7e446aa8a097b43abe37790900 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Fri, 29 Apr 2022 13:04:39 +0800 Subject: [PATCH 4/4] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=20Message=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Shared/Samples/Messages.razor | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/BootstrapBlazor.Shared/Samples/Messages.razor b/src/BootstrapBlazor.Shared/Samples/Messages.razor index 3d37168ed..707f69a4b 100644 --- a/src/BootstrapBlazor.Shared/Samples/Messages.razor +++ b/src/BootstrapBlazor.Shared/Samples/Messages.razor @@ -4,6 +4,20 @@

常用于主动操作后的反馈提示。与 Toast 的区别是后者更多用于系统级通知的被动提醒

+

组件使用介绍:

+ +

1. 注入服务 MessageService

+
@@inject MessageService MessageService
+
[Inject]
+[NotNull]
+private MessageService? MessageService { get; set; }
+
+

2. 调用其实例 api

+
await MessageService.Show(new MessageOption()
+{
+    Content = "这是一条提示消息"
+});
+ -- Gitee