File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,11 @@ export default {
216216 rowKey : "" ,
217217 columnKey : "" ,
218218 } ,
219- // table offest height
219+ /*
220+ table offest height(开启虚拟滚动时使用)
221+ 1、当 :max-height="500" 时使用 max-height
222+ 2、当 max-height="calc(100vh - 210px)" 或者 max-height="80%" 时使用 tableOffestHeight
223+ */
220224 tableOffestHeight : 0 ,
221225 } ;
222226 } ,
@@ -244,16 +248,21 @@ export default {
244248 isVirtualScroll,
245249 virtualScrollOption,
246250 defaultVirtualScrollMinRowHeight,
251+ maxHeight,
247252 tableOffestHeight,
248253 } = this ;
249254
250- if ( isVirtualScroll && tableOffestHeight ) {
255+ if ( isVirtualScroll && maxHeight ) {
251256 const minRowHeight = isNumber ( virtualScrollOption . minRowHeight )
252257 ? virtualScrollOption . minRowHeight
253258 : defaultVirtualScrollMinRowHeight ;
254259
255- // 修复当动态高度 max-height="calc(100vh - 210px)" 时无法计算的问题
256- result = Math . ceil ( tableOffestHeight / minRowHeight ) ;
260+ if ( isNumber ( maxHeight ) ) {
261+ result = Math . ceil ( maxHeight / minRowHeight ) ;
262+ } else if ( tableOffestHeight ) {
263+ // 修复当动态高度 当 max-height="calc(100vh - 210px)" 或者 max-height="80%" 时无法计算的问题
264+ result = Math . ceil ( tableOffestHeight / minRowHeight ) ;
265+ }
257266 }
258267 return result ;
259268 } ,
You can’t perform that action at this time.
0 commit comments