diff --git a/src/BootstrapBlazor/Components/Block/Block.cs b/src/BootstrapBlazor/Components/Block/Block.cs index 464cd72e3891d77b61c62d540ed077d73c50e800..411fe29f2ec560f760840458c49957bde24e3607 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); } diff --git a/src/BootstrapBlazor/Components/Table/TableCellButton.cs b/src/BootstrapBlazor/Components/Table/TableCellButton.cs index 26fe7e47c3dfe8fb375f9ea089ff251079da4514..e38b5c674d457146e23e56acd302434df9e20476 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 方法 ///