mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Stuff
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
<ion-slides>
|
<ion-slides bounce="false">
|
||||||
|
|
||||||
<ion-slide>
|
<ion-slide>
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import {Swiper} from './swiper-widget';
|
|||||||
'loop',
|
'loop',
|
||||||
'index',
|
'index',
|
||||||
'bounce',
|
'bounce',
|
||||||
'hidePager',
|
'showPager',
|
||||||
'options'
|
'options'
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -41,7 +41,7 @@ import {Swiper} from './swiper-widget';
|
|||||||
<div class="swiper-wrapper">
|
<div class="swiper-wrapper">
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
||||||
<div [class.hide]="hidePager" class="swiper-pagination"></div>
|
<div [class.hide]="!showPager" class="swiper-pagination"></div>
|
||||||
</div>`,
|
</div>`,
|
||||||
directives: [NgIf, NgClass]
|
directives: [NgIf, NgClass]
|
||||||
})
|
})
|
||||||
@ -54,12 +54,16 @@ export class Slides extends Ion {
|
|||||||
super(elementRef, config);
|
super(elementRef, config);
|
||||||
}
|
}
|
||||||
onInit() {
|
onInit() {
|
||||||
|
console.log(this.bounce);
|
||||||
var options = util.defaults({
|
var options = util.defaults({
|
||||||
pagination: '.swiper-pagination',
|
pagination: '.swiper-pagination',
|
||||||
paginationClickable: true,
|
paginationClickable: true,
|
||||||
lazyLoading: true
|
lazyLoading: true,
|
||||||
|
//resistance: (this.bounce !== "false")
|
||||||
}, this.options);
|
}, this.options);
|
||||||
|
|
||||||
|
console.log(options);
|
||||||
|
|
||||||
var swiper = new Swiper(this.getNativeElement().children[0], options);
|
var swiper = new Swiper(this.getNativeElement().children[0], options);
|
||||||
|
|
||||||
this.swiper = swiper;
|
this.swiper = swiper;
|
||||||
@ -72,8 +76,10 @@ export class Slides extends Ion {
|
|||||||
update() {
|
update() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.swiper.update();
|
this.swiper.update();
|
||||||
|
|
||||||
|
// Don't allow pager to show with > 10 slides
|
||||||
if(this.swiper.slides.length > 10) {
|
if(this.swiper.slides.length > 10) {
|
||||||
this.hidePager = true;
|
this.showPager = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user