mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-21 04:53:58 +08:00
feat(slides): Added move event onSlideMove
This commit is contained in:
@ -22,7 +22,7 @@ import {Scroll} from '../scroll/scroll';
|
|||||||
* ```ts
|
* ```ts
|
||||||
* @Page({
|
* @Page({
|
||||||
* template: `
|
* template: `
|
||||||
* <ion-slides pager (change)="onSlideChanged($event)" loop="true" autoplay="true">
|
* <ion-slides pager (change)="onSlideChanged($event)" (move)="onSlideMove($event)" loop="true" autoplay="true">
|
||||||
* <ion-slide>
|
* <ion-slide>
|
||||||
* <h3>Thank you for choosing the Awesome App!</h3>
|
* <h3>Thank you for choosing the Awesome App!</h3>
|
||||||
* <p>
|
* <p>
|
||||||
@ -58,6 +58,7 @@ import {Scroll} from '../scroll/scroll';
|
|||||||
* @property {Number} [zoomDuration] - how long it should take to zoom a slide
|
* @property {Number} [zoomDuration] - how long it should take to zoom a slide
|
||||||
* @property {Number} [zoomMax] - the max scale an slide can be zoomed
|
* @property {Number} [zoomMax] - the max scale an slide can be zoomed
|
||||||
* @property {Any} (change) - expression to evaluate when a slide has been changed
|
* @property {Any} (change) - expression to evaluate when a slide has been changed
|
||||||
|
* @property {Any} (move) - expression to evaluate when a slide is moving
|
||||||
* @demo /docs/v2/demos/slides/
|
* @demo /docs/v2/demos/slides/
|
||||||
* @see {@link /docs/v2/components#slides Slides Component Docs}
|
* @see {@link /docs/v2/components#slides Slides Component Docs}
|
||||||
*
|
*
|
||||||
@ -214,6 +215,11 @@ export class Slides extends Ion {
|
|||||||
*/
|
*/
|
||||||
@Output() change: EventEmitter<any> = new EventEmitter();
|
@Output() change: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
@Output() move: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @param {ElementRef} elementRef TODO
|
* @param {ElementRef} elementRef TODO
|
||||||
@ -282,6 +288,10 @@ export class Slides extends Ion {
|
|||||||
options.onLazyImageReady = (swiper, slide, img) => {
|
options.onLazyImageReady = (swiper, slide, img) => {
|
||||||
return this.options.onLazyImageReady && this.options.onLazyImageReady(swiper, slide, img);
|
return this.options.onLazyImageReady && this.options.onLazyImageReady(swiper, slide, img);
|
||||||
};
|
};
|
||||||
|
options.onSliderMove = (swiper, e) => {
|
||||||
|
this.move.emit(swiper, e);
|
||||||
|
return this.options.onSliderMove && this.options.onSliderMove(swiper, e);
|
||||||
|
};
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
var swiper = new Swiper(this.getNativeElement().children[0], options);
|
var swiper = new Swiper(this.getNativeElement().children[0], options);
|
||||||
|
Reference in New Issue
Block a user