public static class AppClient
{
public static void AddSampleRazor(this IServiceCollection services)
{
// 配置建造自动表格页面方法委托
UIConfig.AutoTablePage = (b, m) => b.Component<CustomTablePage>().Set(c => c.Model, m).Build();
}
}
- 添加自定义自动表格页面组件,可以用
C#
或razor
编写
class CustomTablePage : BaseComponent
{
// 自动表格页面配置模型
[Parameter] public TableModel<Dictionary<string, object>> Model { get; set; }
protected override void BuildRender(RenderTreeBuilder builder)
{
builder.Span(Model?.PageName);
}
}
@inherits BaseComponent
<div>@Model?.PageName</div>
@code {
// 自动表格页面配置模型
[Parameter] public TableModel<Dictionary<string, object>> Model { get; set; }
}