@@ -53,7 +53,6 @@ export default {
53
53
select : this . startAt ,
54
54
thumbSelect : this . startAt ,
55
55
lightBoxOn : this . showLightBox ,
56
- countImages : this . images . length ,
57
56
displayThumbs : this . images . slice ( 0 , this . nThumbs ) ,
58
57
timer : null ,
59
58
@@ -62,6 +61,10 @@ export default {
62
61
} ,
63
62
64
63
computed : {
64
+ countImages ( ) {
65
+ return this . images . length
66
+ } ,
67
+
65
68
imagesThumb ( ) {
66
69
if ( this . siteLoading ) {
67
70
return this . displayThumbs . map ( ( { thumb } ) => ( {
@@ -75,16 +78,16 @@ export default {
75
78
} ,
76
79
} ,
77
80
78
- mounted ( ) {
79
- if ( this . autoPlay ) {
80
- this . timer = setInterval ( ( ) => {
81
- this . nextImage ( )
82
- } , this . autoPlayTime )
83
- }
84
- } ,
81
+ watch : {
82
+ startAt ( ) {
83
+ this . $set ( this , 'select' , this . startAt )
84
+ this . $set ( this , 'thumbSelect' , this . startAt )
85
+ } ,
85
86
87
+ images ( ) {
88
+ this . $set ( this , 'displayThumbs' , this . images . slice ( 0 , this . nThumbs ) )
89
+ } ,
86
90
87
- watch : {
88
91
select ( ) {
89
92
let halfDown = Math . floor ( this . nThumbs / 2 )
90
93
let mod = 1 - ( this . nThumbs % 2 )
@@ -119,6 +122,14 @@ export default {
119
122
} ,
120
123
} ,
121
124
125
+ mounted ( ) {
126
+ if ( this . autoPlay ) {
127
+ this . timer = setInterval ( ( ) => {
128
+ this . nextImage ( )
129
+ } , this . autoPlayTime )
130
+ }
131
+ } ,
132
+
122
133
methods : {
123
134
showImage ( index ) {
124
135
document . addEventListener ( 'keydown' , this . addKeyEvent )
0 commit comments