ant-design-blazor/site/AntDesign.Docs/Shared/PlainText.razor
2021-02-06 20:15:46 +08:00

27 lines
501 B
C#

@using System.Net
@inject HtmlRenderService HtmlRenderService
@((MarkupString)text)
@code {
[Parameter]
public RenderFragment ChildContent { get; set; }
private string text { get; set; }
protected override async Task OnInitializedAsync()
{
if (ChildContent != null)
{
text = await HtmlRenderService.RenderAsync(ChildContent);
text = WebUtility.HtmlDecode(text);
}
await base.OnInitializedAsync();
}
}