!2368 doc(#I4SK3J): update sample for EditTemplate of CheckboxList<T>

* doc: 精简代码内置支持 CheckboxList 无需模板
This commit is contained in:
Argo 2022-01-30 03:31:40 +00:00
parent 97c3e181af
commit 34e449b294

View File

@ -20,13 +20,7 @@
<FieldItems>
<EditorItem @bind-Field="@context.Education" Editable="false" />
<EditorItem @bind-Field="@context.Complete" Editable="false" />
<EditorItem @bind-Field="@context.Hobby">
<EditTemplate Context="value">
<div class="col-12">
<CheckboxList @bind-Value="@value.Hobby" Items="@Hobbys" />
</div>
</EditTemplate>
</EditorItem>
<EditorItem @bind-Field="@context.Hobby" Items="@Hobbys" />
</FieldItems>
<Buttons>
<Button Icon="fa fa-save" Text="@Localizer["ButtonText"]" />
@ -43,13 +37,7 @@
<EditorForm Model="@ValidateModel">
<FieldItems>
<EditorItem @bind-Field="@context.DateTime" Readonly="true" />
<EditorItem @bind-Field="@context.Hobby">
<EditTemplate Context="value">
<div class="col-12">
<CheckboxList @bind-Value="@value.Hobby" Items="@Hobbys" />
</div>
</EditTemplate>
</EditorItem>
<EditorItem @bind-Field="@context.Hobby" Items="@Hobbys" />
</FieldItems>
<Buttons>
<Button ButtonType="ButtonType.Submit" Icon="fa fa-save" Text='@Localizer["ButtonText"]' />