File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
src/BootstrapBlazor/Components/Table Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -909,6 +909,11 @@ protected override void OnParametersSet()
909909 {
910910 base . OnParametersSet ( ) ;
911911
912+ if ( ScrollMode == ScrollMode . Virtual && IsTree )
913+ {
914+ throw new InvalidOperationException ( $ "{ GetType ( ) } does not support virtual scrolling in tree mode. ${ GetType ( ) } 目前不支持虚拟滚动模式下设置 IsTree=\" true\" ") ;
915+ }
916+
912917 OnInitParameters ( ) ;
913918
914919 if ( Items != null && OnQueryAsync != null )
Original file line number Diff line number Diff line change @@ -2693,6 +2693,7 @@ public void ScrollMode_Ok()
26932693 var localizer = Context . Services . GetRequiredService < IStringLocalizer < Foo > > ( ) ;
26942694 var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
26952695 {
2696+ pb . Add ( a => a . EnableErrorLogger , false ) ;
26962697 pb . AddChildContent < Table < Foo > > ( pb =>
26972698 {
26982699 pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
@@ -2710,6 +2711,13 @@ public void ScrollMode_Ok()
27102711 } ) ;
27112712 var virtualComponent = cut . FindComponent < Virtualize < Foo > > ( ) ;
27122713 Assert . NotNull ( virtualComponent ) ;
2714+
2715+ var table = cut . FindComponent < Table < Foo > > ( ) ;
2716+ var exception = Assert . Throws < InvalidOperationException > ( ( ) => table . SetParametersAndRender ( pb =>
2717+ {
2718+ pb . Add ( a => a . IsTree , true ) ;
2719+ } ) ) ;
2720+ Assert . NotNull ( exception ) ;
27132721 }
27142722
27152723 [ Fact ]
You can’t perform that action at this time.
0 commit comments