mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
feat(swiper): expose full API (#19137)
* expose full swiper API * update types * run build * run angular build
This commit is contained in:
@ -614,6 +614,18 @@ Type: `Promise<number>`
|
||||
|
||||
|
||||
|
||||
### `getSwiper() => Promise<any>`
|
||||
|
||||
Get the Swiper instance.
|
||||
Use this to access the full Swiper API.
|
||||
See https://idangero.us/swiper/api/ for all API options.
|
||||
|
||||
#### Returns
|
||||
|
||||
Type: `Promise<any>`
|
||||
|
||||
|
||||
|
||||
### `isBeginning() => Promise<boolean>`
|
||||
|
||||
Get whether or not the current slide is the first slide.
|
||||
|
@ -320,6 +320,16 @@ export class Slides implements ComponentInterface {
|
||||
swiper.allowTouchMove = !lock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Swiper instance.
|
||||
* Use this to access the full Swiper API.
|
||||
* See https://idangero.us/swiper/api/ for all API options.
|
||||
*/
|
||||
@Method()
|
||||
async getSwiper(): Promise<any> {
|
||||
return this.swiper;
|
||||
}
|
||||
|
||||
private async initSwiper() {
|
||||
const finalOptions = this.normalizeOptions();
|
||||
|
||||
@ -332,10 +342,6 @@ export class Slides implements ComponentInterface {
|
||||
this.readySwiper(swiper);
|
||||
}
|
||||
|
||||
private getSwiper() {
|
||||
return this.swiper;
|
||||
}
|
||||
|
||||
private normalizeOptions(): SwiperOptions {
|
||||
// Base options, can be changed
|
||||
// TODO Add interface SwiperOptions
|
||||
|
Reference in New Issue
Block a user