mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(slides): expose interface to provide custom animations (#17959)
fixes #16616 Co-Authored-By: CFT-Chris <mail@chrislo.ca>
This commit is contained in:
@ -313,7 +313,7 @@ export class Slides implements ComponentInterface {
|
||||
// Base options, can be changed
|
||||
// TODO Add interface SwiperOptions
|
||||
const swiperOptions: SwiperOptions = {
|
||||
effect: 'slide',
|
||||
effect: undefined,
|
||||
direction: 'horizontal',
|
||||
initialSlide: 0,
|
||||
loop: false,
|
||||
@ -438,8 +438,13 @@ export class Slides implements ComponentInterface {
|
||||
}
|
||||
};
|
||||
|
||||
const customEvents = (!!this.options && !!this.options.on) ? this.options.on : {};
|
||||
|
||||
// merge "on" event listeners, while giving our event listeners priority
|
||||
const mergedEventOptions = { on: { ...customEvents, ...eventOptions.on } };
|
||||
|
||||
// Merge the base, user options, and events together then pas to swiper
|
||||
return { ...swiperOptions, ...this.options, ...eventOptions };
|
||||
return { ...swiperOptions, ...this.options, ...mergedEventOptions };
|
||||
}
|
||||
|
||||
hostData() {
|
||||
|
Reference in New Issue
Block a user