mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-01 19:48:17 +08:00
37 lines
706 B
C#
37 lines
706 B
C#
@using AntDesign.Docs.Services
|
||
@using System.Reflection;
|
||
@inherits ComponentBase
|
||
|
||
@if (_demoType != null)
|
||
{
|
||
<DynamicComponent Type="_demoType" />
|
||
}
|
||
|
||
@inject DemoService demoService;
|
||
@code {
|
||
|
||
[Parameter]
|
||
public DemoItem Demo { get; set; }
|
||
|
||
private Type _demoType;
|
||
|
||
private bool _render;
|
||
|
||
protected override void OnAfterRender(bool firstRender)
|
||
{
|
||
if (firstRender)
|
||
{
|
||
_render = true;
|
||
StateHasChanged();
|
||
return;
|
||
}
|
||
if (_render && _demoType == null)
|
||
{
|
||
_demoType = demoService.GetShowCase(Demo.Type);
|
||
StateHasChanged();
|
||
}
|
||
|
||
base.OnAfterRender(firstRender);
|
||
|
||
}
|
||
} |