File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
src/BootstrapBlazor/Components/Table Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 44// Maintainer: Argo Zhang([email protected] ) Website: https://www.blazor.zone 55
66using Microsoft . AspNetCore . Components . Rendering ;
7- using System . ComponentModel ;
87
98namespace BootstrapBlazor . Components ;
109
1110internal class LookupContent : ComponentBase
1211{
12+ /// <summary>
13+ /// 获得/设置 <see cref="ILookupService"/> 服务实例
14+ /// </summary>
15+ [ Parameter ]
16+ public IEnumerable < SelectedItem > ? Lookup { get ; set ; }
17+
1318 /// <summary>
1419 /// 获得/设置 <see cref="ILookupService"/> 服务实例
1520 /// </summary>
@@ -76,8 +81,16 @@ protected override void BuildRenderTree(RenderTreeBuilder builder)
7681
7782 private async Task < List < SelectedItem > > GetLookupItemsAsync ( )
7883 {
79- var lookupService = LookupService ?? InjectLookupService ;
80- var items = await lookupService . GetItemsAsync ( LookupServiceKey , LookupServiceData ) ;
84+ IEnumerable < SelectedItem > ? items ;
85+ if ( Lookup != null )
86+ {
87+ items = Lookup ;
88+ }
89+ else
90+ {
91+ var lookupService = LookupService ?? InjectLookupService ;
92+ items = await lookupService . GetItemsAsync ( LookupServiceKey , LookupServiceData ) ;
93+ }
8194 return items ? . ToList ( ) ?? [ ] ;
8295 }
8396}
You can’t perform that action at this time.
0 commit comments