@@ -99,7 +99,7 @@ const VirtualList = Vue.component('virtual-list', {
99
99
// return current scroll offset
100
100
getOffset ( ) {
101
101
if ( this . pageMode ) {
102
- return document . documentElement [ this . directionKey ]
102
+ return document . documentElement [ this . directionKey ] || document . body [ this . directionKey ]
103
103
} else {
104
104
const { root } = this . $refs
105
105
return root ? Math . ceil ( root [ this . directionKey ] ) : 0
@@ -110,7 +110,7 @@ const VirtualList = Vue.component('virtual-list', {
110
110
getClientSize ( ) {
111
111
const key = this . isHorizontal ? 'clientWidth' : 'clientHeight'
112
112
if ( this . pageMode ) {
113
- return document . documentElement [ key ]
113
+ return document . documentElement [ key ] || document . body [ key ]
114
114
} else {
115
115
const { root } = this . $refs
116
116
return root ? root [ key ] : 0
@@ -121,7 +121,7 @@ const VirtualList = Vue.component('virtual-list', {
121
121
getScrollSize ( ) {
122
122
const key = this . isHorizontal ? 'scrollWidth' : 'scrollHeight'
123
123
if ( this . pageMode ) {
124
- return document . documentElement [ key ]
124
+ return document . documentElement [ key ] || document . body [ key ]
125
125
} else {
126
126
const { root } = this . $refs
127
127
return root ? root [ key ] : 0
@@ -131,6 +131,7 @@ const VirtualList = Vue.component('virtual-list', {
131
131
// set current scroll position to a expectant offset
132
132
scrollToOffset ( offset ) {
133
133
if ( this . pageMode ) {
134
+ document . body [ this . directionKey ] = offset
134
135
document . documentElement [ this . directionKey ] = offset
135
136
} else {
136
137
const { root } = this . $refs
0 commit comments