File tree Expand file tree Collapse file tree 8 files changed +449
-13
lines changed
core/src/components/slides Expand file tree Collapse file tree 8 files changed +449
-13
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ export class Slides implements ComponentInterface {
313
313
// Base options, can be changed
314
314
// TODO Add interface SwiperOptions
315
315
const swiperOptions : SwiperOptions = {
316
- effect : 'slide' ,
316
+ effect : undefined ,
317
317
direction : 'horizontal' ,
318
318
initialSlide : 0 ,
319
319
loop : false ,
@@ -438,8 +438,13 @@ export class Slides implements ComponentInterface {
438
438
}
439
439
} ;
440
440
441
+ const customEvents = ( ! ! this . options && ! ! this . options . on ) ? this . options . on : { } ;
442
+
443
+ // merge "on" event listeners, while giving our event listeners priority
444
+ const mergedEventOptions = { on : { ...customEvents , ...eventOptions . on } } ;
445
+
441
446
// Merge the base, user options, and events together then pas to swiper
442
- return { ...swiperOptions , ...this . options , ...eventOptions } ;
447
+ return { ...swiperOptions , ...this . options , ...mergedEventOptions } ;
443
448
}
444
449
445
450
hostData ( ) {
Original file line number Diff line number Diff line change 24
24
< ion-content id ="content ">
25
25
< ion-slides style ="background: black " id ="slides " pager >
26
26
< ion-slide style ="background: rgb(0, 200, 0); color: white; ">
27
- < img src ="http://lorempixel.com/400/200/cats/ ">
27
+ < img src ="image/cat.jpeg ">
28
28
</ ion-slide >
29
29
< ion-slide style ="background: white; color: blue; ">
30
- < img src ="http://lorempixel.com/400/200/cats/ ">
30
+ < img src ="image/cat.jpeg ">
31
31
</ ion-slide >
32
32
< ion-slide style ="background: blue; color: white; ">
33
- < img src ="http://lorempixel.com/400/200/cats/ ">
33
+ < img src ="image/cat.jpeg ">
34
34
</ ion-slide >
35
35
</ ion-slides >
36
36
< ion-button expand ="block " onclick ="slidePrev() "> Slide Prev</ ion-button >
Original file line number Diff line number Diff line change @@ -18,8 +18,10 @@ import { Component } from '@angular/core';
18
18
`
19
19
})
20
20
export class SlideExample {
21
+ // Optional parameters to pass to the swiper instance. See http://idangero.us/swiper/api/ for valid options.
21
22
slideOpts = {
22
- effect: ' flip'
23
+ initialSlide: 1 ,
24
+ speed: 400
23
25
};
24
26
constructor () {}
25
27
}
Original file line number Diff line number Diff line change 17
17
18
18
``` javascript
19
19
var slides = document .querySelector (' ion-slides' );
20
+
21
+ // Optional parameters to pass to the swiper instance. See http://idangero.us/swiper/api/ for valid options.
20
22
slides .options = {
21
- effect: ' flip'
23
+ initialSlide: 1 ,
24
+ speed: 400
22
25
}
23
26
```
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ import React from 'react';
3
3
4
4
import { IonSlides , IonSlide } from ' @ionic/react' ;
5
5
6
+ // Optional parameters to pass to the swiper instance. See http://idangero.us/swiper/api/ for valid options.
6
7
const slideOpts = {
7
- effect: ' flip'
8
+ initialSlide: 1 ,
9
+ speed: 400
8
10
};
9
11
10
12
const Example: React .SFC <{}> = () => (
Original file line number Diff line number Diff line change 19
19
20
20
@Component ()
21
21
export default class SelectExample extends Vue {
22
+ // Optional parameters to pass to the swiper instance. See http://idangero.us/swiper/api/ for valid options.
22
23
slideOpts = {
23
- effect: ' flip'
24
+ initialSlide: 1 ,
25
+ speed: 400
24
26
};
25
27
}
26
28
</script >
You can’t perform that action at this time.
0 commit comments