@@ -125,7 +125,8 @@ const VirtualList = Vue.component('virtual-list', {
125
125
scrollToBottom ( ) {
126
126
const { shepherd } = this . $refs
127
127
if ( shepherd ) {
128
- this . scrollToOffset ( shepherd [ this . isHorizontal ? 'offsetLeft' : 'offsetTop' ] )
128
+ const offset = shepherd [ this . isHorizontal ? 'offsetLeft' : 'offsetTop' ]
129
+ this . scrollToOffset ( offset )
129
130
130
131
// check if it's really scrolled to the bottom
131
132
// maybe list doesn't render and calculate to last range
@@ -254,8 +255,8 @@ const VirtualList = Vue.component('virtual-list', {
254
255
render ( h ) {
255
256
const { header, footer } = this . $slots
256
257
const { padFront, padBehind } = this . range
257
- const { rootTag, headerClass, headerTag, wrapTag, wrapClass, footerClass, footerTag } = this
258
- const padding = this . isHorizontal ? `0px ${ padBehind } px 0px ${ padFront } px` : `${ padFront } px 0px ${ padBehind } px`
258
+ const { rootTag, headerClass, headerTag, wrapTag, wrapClass, footerClass, footerTag, isHorizontal } = this
259
+ const padding = isHorizontal ? `0px ${ padBehind } px 0px ${ padFront } px` : `${ padFront } px 0px ${ padBehind } px`
259
260
260
261
return h ( rootTag , {
261
262
ref : 'root' ,
@@ -296,7 +297,11 @@ const VirtualList = Vue.component('virtual-list', {
296
297
297
298
// an empty element use to scroll to bottom
298
299
h ( 'div' , {
299
- ref : 'shepherd'
300
+ ref : 'shepherd' ,
301
+ style : {
302
+ width : isHorizontal ? '0px' : '100%' ,
303
+ height : isHorizontal ? '100%' : '0px'
304
+ }
300
305
} )
301
306
] )
302
307
}
0 commit comments