diff --git a/src/BootstrapBlazor.Shared/Pages/Samples/Table/TablesVirtualization.razor b/src/BootstrapBlazor.Shared/Pages/Samples/Table/TablesVirtualization.razor index 53446f928b23508beed5d8eb1d2b290061a39a77..22e3c28459d69fc34edacd29c31f08f561966290 100644 --- a/src/BootstrapBlazor.Shared/Pages/Samples/Table/TablesVirtualization.razor +++ b/src/BootstrapBlazor.Shared/Pages/Samples/Table/TablesVirtualization.razor @@ -7,7 +7,7 @@

需要设置 ScrollMode Height RowHeight PageItems 参数对虚拟滚动进行设置

-
+
@@ -23,7 +23,7 @@

快速滚动时显示行占位,提升用户体验

-
+
diff --git a/src/BootstrapBlazor.Shared/wwwroot/css/site.css b/src/BootstrapBlazor.Shared/wwwroot/css/site.css index 432d24283c31f7e20ca08edde5ae1551faedd6af..85eac0cf5b506b7da10026d83bff654c3a0279e9 100644 --- a/src/BootstrapBlazor.Shared/wwwroot/css/site.css +++ b/src/BootstrapBlazor.Shared/wwwroot/css/site.css @@ -1187,6 +1187,20 @@ section { text-overflow: ellipsis; } +.table-virtualize-demo { + height: 400px; +} + + .table-virtualize-demo .table-cell { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .table-virtualize-demo .table-fixed-body { + overflow-x: hidden !important; + } + .install-prompt { position: fixed; bottom: 0.5rem; diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index ec99de43138649bc89c6057dd328982692d50746..ab12bbe335790ac1b8a6b9f2d5da5c19b0ff2121 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -710,7 +710,7 @@ namespace BootstrapBlazor.Components if (ScrollMode == ScrollMode.Virtual) { IsFixedHeader = true; - Height ??= 400; + RenderMode = TableRenderMode.Table; } RowItemsCache = null;