@@ -99,7 +99,7 @@ const VirtualList = Vue.component('virtual-list', {
9999 // return current scroll offset
100100 getOffset ( ) {
101101 if ( this . pageMode ) {
102- return document . documentElement [ this . directionKey ]
102+ return document . documentElement [ this . directionKey ] || document . body [ this . directionKey ]
103103 } else {
104104 const { root } = this . $refs
105105 return root ? Math . ceil ( root [ this . directionKey ] ) : 0
@@ -110,7 +110,7 @@ const VirtualList = Vue.component('virtual-list', {
110110 getClientSize ( ) {
111111 const key = this . isHorizontal ? 'clientWidth' : 'clientHeight'
112112 if ( this . pageMode ) {
113- return document . documentElement [ key ]
113+ return document . documentElement [ key ] || document . body [ key ]
114114 } else {
115115 const { root } = this . $refs
116116 return root ? root [ key ] : 0
@@ -121,7 +121,7 @@ const VirtualList = Vue.component('virtual-list', {
121121 getScrollSize ( ) {
122122 const key = this . isHorizontal ? 'scrollWidth' : 'scrollHeight'
123123 if ( this . pageMode ) {
124- return document . documentElement [ key ]
124+ return document . documentElement [ key ] || document . body [ key ]
125125 } else {
126126 const { root } = this . $refs
127127 return root ? root [ key ] : 0
@@ -131,6 +131,7 @@ const VirtualList = Vue.component('virtual-list', {
131131 // set current scroll position to a expectant offset
132132 scrollToOffset ( offset ) {
133133 if ( this . pageMode ) {
134+ document . body [ this . directionKey ] = offset
134135 document . documentElement [ this . directionKey ] = offset
135136 } else {
136137 const { root } = this . $refs
0 commit comments