コード例 #1
0
 /// <summary>
 /// 渲染 Step 组件方法
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected virtual RenderFragment RenderStep(StepItem item) => new RenderFragment(builder =>
 {
     item.Space = ParseSpace(item.Space);
     var index  = 0;
     builder.OpenComponent <Step>(index++);
     builder.SetKey(item);
     builder.AddAttribute(index++, nameof(Step.Title), item.Title);
     builder.AddAttribute(index++, nameof(Step.Icon), item.Icon);
     builder.AddAttribute(index++, nameof(Step.Description), item.Description);
     builder.AddAttribute(index++, nameof(Step.Space), item.Space);
     builder.AddAttribute(index++, nameof(Step.Status), item.Status);
     builder.AddAttribute(index++, nameof(Step.IsLast), item == Items.Last());
     builder.AddAttribute(index++, nameof(Step.IsCenter), IsCenter);
     builder.AddAttribute(index++, nameof(Step.StepIndex), Items.ToList().IndexOf(item));
     builder.CloseComponent();
 });
コード例 #2
0
ファイル: StepsBase.cs プロジェクト: LXG6869/BootstrapBlazor
 /// <summary>
 /// 渲染 Step 组件方法
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 protected virtual RenderFragment RenderStep(StepItem item) => new(builder =>