Class Block
- Namespace
- BootstrapBlazor.Components
- Assembly
- BootstrapBlazor.dll
条件输出自组件
public class Block : BootstrapComponentBase, IComponent, IHandleAfterRender, IHandleEvent
- Inheritance
-
Block
- Implements
- Inherited Members
- Extension Methods
Constructors
Block()
public Block()
Properties
Authorized
获得/设置 符合条件显示的内容
[Parameter]
public RenderFragment? Authorized { get; set; }
Property Value
ChildContent
获得/设置 子组件内容
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
Condition
获得/设置 是否显示此 Block 默认显示 null 未参与判断 设置 true 时显示
[Parameter]
public bool? Condition { get; set; }
Property Value
- bool?
Name
获得/设置 Block 名字 此名字通过 OnQueryCondition 第一个参数传递给使用者
[Parameter]
public string? Name { get; set; }
Property Value
NotAuthorized
获得/设置 不符合条件显示的内容
[Parameter]
public RenderFragment? NotAuthorized { get; set; }
Property Value
OnQueryCondition
获得/设置 是否显示此 Block 默认显示 返回 true 时显示
[Parameter]
public Func<string?, Task<bool>>? OnQueryCondition { get; set; }
Property Value
Roles
获得/设置 Block 允许的角色集合
[Parameter]
public IEnumerable<string>? Roles { get; set; }
Property Value
Users
获得/设置 Block 允许的用户集合
[Parameter]
public IEnumerable<string>? Users { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
BuildRenderTree 方法
protected override void BuildRenderTree(RenderTreeBuilder builder)
Parameters
builder
RenderTreeBuilder
OnParametersSetAsync()
OnParametersSetAsync 方法
protected override Task OnParametersSetAsync()