Loading

Blazor笔记-Component RenderFragment / ChildContent

更新记录

注意:非教程。纯笔记,日常查询用的。需要教程的小伙伴找几本书看看即可哈哈,有Vue基础的话非常快,概念都是通的。非工作需要不建议深入学习Blazor,深入Vue吧,用的多,哈哈。

完整目录地址:https://www.cnblogs.com/cqpanda/p/17596348.html

点击查看
2024年3月7日 发布。
2023年8月1日 迁移笔记到博客。

Component RenderFragment / ChildContent

RenderFragment

There are two types of render elements, RenderFragment and RenderFragment<T>. RenderFragment is simply a Razor fragment without any input parameters, and RenderFragment<T> has an input parameter that you can use inside the Razor fragment code by using the context keyword.

ChildContent

<div class="alert alert-primary" role="alert">
 @ChildContent
</div>

@code{
 [Parameter]
 public RenderFragment ChildContent { get; set; } =@<b>This is a default value</b>;
}
posted @ 2024-03-07 15:32  重庆熊猫  阅读(11)  评论(0编辑  收藏  举报