mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
31 lines
694 B
C#
31 lines
694 B
C#
@layout BlankLayout;
|
|
@page "/mock"
|
|
@using System.Reflection
|
|
@using AntDesign.Docs.Services
|
|
|
|
<div id="@DemoId">
|
|
@ShowCaseContent
|
|
</div>
|
|
|
|
@inject DemoService demoService
|
|
|
|
@code
|
|
{
|
|
[Parameter]
|
|
public string DemoId { get; set; }
|
|
|
|
[Parameter]
|
|
public string Type { get; set; }
|
|
|
|
[Parameter(CaptureUnmatchedValues = true)]
|
|
public IDictionary<string,object> Attributes { get; set; }
|
|
|
|
RenderFragment ShowCaseContent => (builder) =>
|
|
{
|
|
var assemblyName = Assembly.GetExecutingAssembly().GetName().Name;
|
|
var showCase = System.Type.GetType($"{assemblyName}.{Type}");
|
|
builder.OpenComponent(0, showCase);
|
|
builder.CloseComponent();
|
|
};
|
|
}
|