@code { private int DataPrimaryId { get; set; } private Task OnClickShowDataById() { DialogService?.Show(new DialogOption() { Title = "数据查询窗口", BodyContext = DataPrimaryId, BodyTemplate = builder => { var index = 0; builder.OpenComponent(index++); builder.CloseComponent(); } }); return Task.CompletedTask; } } // 组件示例代码请查看 https://gitee.com/LongbowEnterprise/BootstrapBlazor/blob/dev/src/BootstrapBlazor.Shared/Pages/Components/DataDialogComponent.razor