From d5de154a97e2bf9b06a1fe9caef19de400efce18 Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Wed, 15 Dec 2021 19:42:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E5=BC=83?= =?UTF-8?q?=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/TableCellButton.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/BootstrapBlazor/Components/Table/TableCellButton.cs b/src/BootstrapBlazor/Components/Table/TableCellButton.cs index 26fe7e47c..e38b5c674 100644 --- a/src/BootstrapBlazor/Components/Table/TableCellButton.cs +++ b/src/BootstrapBlazor/Components/Table/TableCellButton.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Components; using System; +using System.Threading.Tasks; namespace BootstrapBlazor.Components { @@ -24,6 +25,13 @@ namespace BootstrapBlazor.Components [Parameter] public bool AutoSelectedRowWhenClick { get; set; } = true; + /// + /// 获得/设置 按钮点击后的回调方法 + /// + [Parameter] + [Obsolete($"本回调已弃用,请使用 {nameof(ButtonBase.OnClick)} 或者 {nameof(ButtonBase.OnClickWithoutRender)} 均可", true)] + public Func? OnClickCallback { get; set; } + /// /// OnInitialized 方法 /// -- Gitee From 5cf81a284abd7b0db18cdfa105f8ea73ff4851cb Mon Sep 17 00:00:00 2001 From: Argo-Tianyi Date: Thu, 16 Dec 2021 11:53:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20Block=20=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20Condition=20=E5=8F=82=E6=95=B0=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Block/Block.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Block/Block.cs b/src/BootstrapBlazor/Components/Block/Block.cs index 464cd72e3..411fe29f2 100644 --- a/src/BootstrapBlazor/Components/Block/Block.cs +++ b/src/BootstrapBlazor/Components/Block/Block.cs @@ -14,7 +14,7 @@ using System.Threading.Tasks; namespace BootstrapBlazor.Components { /// - /// + /// 条件输出自组件 /// public class Block : BootstrapComponentBase { @@ -40,9 +40,14 @@ namespace BootstrapBlazor.Components /// 获得/设置 是否显示此 Block 默认显示 /// [Parameter] - [NotNull] public Func>? OnQueryCondition { get; set; } + /// + /// 获得/设置 是否显示此 Block 默认显示 null 未参与判断 + /// + [Parameter] + public bool? Condition { get; set; } + /// /// 获得/设置 子组件内容 /// @@ -81,7 +86,11 @@ namespace BootstrapBlazor.Components { IsShow = await ProcessAuthorizeAsync(); } - if (OnQueryCondition != null) + else if (Condition.HasValue) + { + IsShow = Condition.Value; + } + else if (OnQueryCondition != null) { IsShow = await OnQueryCondition(Name); } -- Gitee