File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 250
250
return this . gridWidth < 0 ? this . windowWidth : Math . min ( this . windowWidth , this . gridWidth ) ;
251
251
} ,
252
252
height : function ( ) {
253
- return Math . ceil ( this . items . length / this . rowCount ) * this . cellHeight ;
253
+ return Math . ceil ( this . list . length / this . rowCount ) * this . cellHeight ;
254
254
} ,
255
255
style : function ( ) {
256
256
return {
262
262
} ,
263
263
rowShift : function ( ) {
264
264
if ( this . center ) {
265
- var contentWidth = this . items . length * this . cellWidth , rowShift = contentWidth < this . gridResponsiveWidth ? ( this . gridResponsiveWidth - contentWidth ) / 2 : this . gridResponsiveWidth % this . cellWidth / 2 ;
265
+ var contentWidth = this . list . length * this . cellWidth , rowShift = contentWidth < this . gridResponsiveWidth ? ( this . gridResponsiveWidth - contentWidth ) / 2 : this . gridResponsiveWidth % this . cellWidth / 2 ;
266
266
return Math . floor ( rowShift ) ;
267
267
}
268
268
return 0 ;
491
491
created : function ( ) {
492
492
window . addEventListener ( "resize" , this . getWindowSize ) , this . getWindowSize ( ) ;
493
493
} ,
494
+ mounted : function ( ) {
495
+ this . getWindowSize ( ) ;
496
+ } ,
494
497
beforeDestroy : function ( ) {
495
498
window . removeEventListener ( "resize" , this . getWindowSize ) ;
496
499
} ,
497
500
methods : {
498
501
getWindowSize : function ( ) {
499
- this . windowHeight = window . innerHeight , this . windowWidth = window . innerWidth ;
502
+ this . $el && ( this . windowHeight = this . $el . clientHeight , this . windowWidth = this . $el . clientWidth ) ;
500
503
}
501
504
}
502
505
} ;
558
561
on : {
559
562
mousedown : _vm . mousedown ,
560
563
touchstart : function ( $event ) {
561
- $event . stopPropagation ( ) , _vm . mousedown ( $event ) ;
564
+ return $event . stopPropagation ( ) , _vm . mousedown ( $event ) ;
562
565
}
563
566
}
564
567
} , [ _vm . _t ( "default" ) ] , 2 ) ;
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ export default {
97
97
},
98
98
99
99
height () {
100
- return Math .ceil (this .items .length / this .rowCount ) *
100
+ return Math .ceil (this .list .length / this .rowCount ) *
101
101
this .cellHeight
102
102
},
103
103
@@ -113,7 +113,7 @@ export default {
113
113
114
114
rowShift () {
115
115
if (this .center ) {
116
- let contentWidth = this .items .length * this .cellWidth
116
+ let contentWidth = this .list .length * this .cellWidth
117
117
let rowShift = contentWidth < this .gridResponsiveWidth
118
118
? (this .gridResponsiveWidth - contentWidth) / 2
119
119
: (this .gridResponsiveWidth % this .cellWidth ) / 2
You can’t perform that action at this time.
0 commit comments