File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ import {Scroll} from '../scroll/scroll';
72
72
'<div [class.hide]="!showPager" class="swiper-pagination"></div>' +
73
73
'</div>' ,
74
74
directives : [ NgClass ] ,
75
+ host : {
76
+ '[id]' : 'slideId'
77
+ } ,
75
78
changeDetection : ChangeDetectionStrategy . OnPush ,
76
79
encapsulation : ViewEncapsulation . None ,
77
80
} )
@@ -82,6 +85,16 @@ export class Slides extends Ion {
82
85
*/
83
86
public rapidUpdate : Function ;
84
87
88
+ /**
89
+ * @private
90
+ */
91
+ private id : number ;
92
+
93
+ /**
94
+ * @private
95
+ */
96
+ private slideId : string ;
97
+
85
98
/**
86
99
* @private
87
100
*/
@@ -204,6 +217,9 @@ export class Slides extends Ion {
204
217
this . rapidUpdate = debounce ( ( ) => {
205
218
this . update ( ) ;
206
219
} , 10 ) ;
220
+
221
+ this . id = ++ slidesId ;
222
+ this . slideId = 'slides-' + this . id ;
207
223
}
208
224
209
225
/**
@@ -216,8 +232,10 @@ export class Slides extends Ion {
216
232
217
233
this . showPager = isTrueProperty ( this . pager ) ;
218
234
235
+ let paginationId = '#' + this . slideId + ' .swiper-pagination' ;
236
+
219
237
var options = defaults ( {
220
- pagination : '.swiper-pagination' ,
238
+ pagination : paginationId ,
221
239
} , this . options ) ;
222
240
223
241
options . onTap = ( swiper , e ) => {
@@ -706,3 +724,5 @@ export class Slide {
706
724
}
707
725
} )
708
726
export class SlideLazy { }
727
+
728
+ let slidesId = - 1 ;
You can’t perform that action at this time.
0 commit comments