Table of Contents

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

RenderFragment

ChildContent

获得/设置 子组件内容

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Condition

获得/设置 是否显示此 Block 默认显示 null 未参与判断 设置 true 时显示

[Parameter]
public bool? Condition { get; set; }

Property Value

bool?

Name

获得/设置 Block 名字 此名字通过 OnQueryCondition 第一个参数传递给使用者

[Parameter]
public string? Name { get; set; }

Property Value

string

NotAuthorized

获得/设置 不符合条件显示的内容

[Parameter]
public RenderFragment? NotAuthorized { get; set; }

Property Value

RenderFragment

OnQueryCondition

获得/设置 是否显示此 Block 默认显示 返回 true 时显示

[Parameter]
public Func<string?, Task<bool>>? OnQueryCondition { get; set; }

Property Value

Func<string, Task<bool>>

Roles

获得/设置 Block 允许的角色集合

[Parameter]
public IEnumerable<string>? Roles { get; set; }

Property Value

IEnumerable<string>

Users

获得/设置 Block 允许的用户集合

[Parameter]
public IEnumerable<string>? Users { get; set; }

Property Value

IEnumerable<string>

Methods

BuildRenderTree(RenderTreeBuilder)

BuildRenderTree 方法

protected override void BuildRenderTree(RenderTreeBuilder builder)

Parameters

builder RenderTreeBuilder

OnParametersSetAsync()

OnParametersSetAsync 方法

protected override Task OnParametersSetAsync()

Returns

Task