From e0eeb67192721b59805fae76c8ef4ee562444ac6 Mon Sep 17 00:00:00 2001 From: wanghaoo Date: Tue, 25 Dec 2018 13:34:37 +0800 Subject: [PATCH] 1 --- src/lib/bigData.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/bigData.js b/src/lib/bigData.js index 0374b0e..c265edd 100644 --- a/src/lib/bigData.js +++ b/src/lib/bigData.js @@ -22,7 +22,8 @@ export default function bigData(Table) { }; const rowHeight = this.props.height?this.props.height:defaultHeight //默认显示25条,rowsInView根据定高算的。在非固定高下,这个只是一个大概的值。 - this.rowsInView = this.props.scroll.y?Math.ceil(this.props.scroll.y/rowHeight):20 ; + const scrollY = this.props.scroll.y ? parseInt(this.props.scroll.y) : 0; + this.rowsInView = scrollY ? Math.ceil(scrollY/rowHeight):20 ; this.currentIndex = 0; this.loadCount = props.loadBuffer? this.rowsInView + props.loadBuffer*2:26;//一次加载多少数据 this.cachedRowHeight = [];//缓存每行的高度