File tree 2 files changed +13
-0
lines changed
src/BootstrapBlazor/Components/Table
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()
909
909
{
910
910
base . OnParametersSet ( ) ;
911
911
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
+
912
917
OnInitParameters ( ) ;
913
918
914
919
if ( Items != null && OnQueryAsync != null )
Original file line number Diff line number Diff line change @@ -2693,6 +2693,7 @@ public void ScrollMode_Ok()
2693
2693
var localizer = Context . Services . GetRequiredService < IStringLocalizer < Foo > > ( ) ;
2694
2694
var cut = Context . RenderComponent < BootstrapBlazorRoot > ( pb =>
2695
2695
{
2696
+ pb . Add ( a => a . EnableErrorLogger , false ) ;
2696
2697
pb . AddChildContent < Table < Foo > > ( pb =>
2697
2698
{
2698
2699
pb . Add ( a => a . RenderMode , TableRenderMode . Table ) ;
@@ -2710,6 +2711,13 @@ public void ScrollMode_Ok()
2710
2711
} ) ;
2711
2712
var virtualComponent = cut . FindComponent < Virtualize < Foo > > ( ) ;
2712
2713
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 ) ;
2713
2721
}
2714
2722
2715
2723
[ Fact ]
You can’t perform that action at this time.
0 commit comments