mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
docs(components): update method and parameter descriptions (#18075)
This commit is contained in:
@ -645,15 +645,15 @@ Type: `Promise<number>`
|
||||
|
||||
|
||||
|
||||
### `lockSwipeToNext(shouldLockSwipeToNext: boolean) => Promise<void>`
|
||||
### `lockSwipeToNext(lock: boolean) => Promise<void>`
|
||||
|
||||
Lock or unlock the ability to slide to the next slides.
|
||||
Lock or unlock the ability to slide to the next slide.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------------------- | --------- | ----------- |
|
||||
| `shouldLockSwipeToNext` | `boolean` | |
|
||||
| Name | Type | Description |
|
||||
| ------ | --------- | --------------------------------------------- |
|
||||
| `lock` | `boolean` | If `true`, disable swiping to the next slide. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -661,15 +661,15 @@ Type: `Promise<void>`
|
||||
|
||||
|
||||
|
||||
### `lockSwipeToPrev(shouldLockSwipeToPrev: boolean) => Promise<void>`
|
||||
### `lockSwipeToPrev(lock: boolean) => Promise<void>`
|
||||
|
||||
Lock or unlock the ability to slide to the previous slides.
|
||||
Lock or unlock the ability to slide to the previous slide.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------------------- | --------- | ----------- |
|
||||
| `shouldLockSwipeToPrev` | `boolean` | |
|
||||
| Name | Type | Description |
|
||||
| ------ | --------- | ------------------------------------------------- |
|
||||
| `lock` | `boolean` | If `true`, disable swiping to the previous slide. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -677,15 +677,15 @@ Type: `Promise<void>`
|
||||
|
||||
|
||||
|
||||
### `lockSwipes(shouldLockSwipes: boolean) => Promise<void>`
|
||||
### `lockSwipes(lock: boolean) => Promise<void>`
|
||||
|
||||
Lock or unlock the ability to slide to change slides.
|
||||
Lock or unlock the ability to slide to the next or previous slide.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------------ | --------- | ----------- |
|
||||
| `shouldLockSwipes` | `boolean` | |
|
||||
| Name | Type | Description |
|
||||
| ------ | --------- | ---------------------------------------------------------- |
|
||||
| `lock` | `boolean` | If `true`, disable swiping to the next and previous slide. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -699,10 +699,10 @@ Transition to the next slide.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------------- | ---------------------- | ----------- |
|
||||
| `speed` | `number \| undefined` | |
|
||||
| `runCallbacks` | `boolean \| undefined` | |
|
||||
| Name | Type | Description |
|
||||
| -------------- | ---------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| `speed` | `number \| undefined` | The transition duration (in ms). |
|
||||
| `runCallbacks` | `boolean \| undefined` | If true, the transition will produce [Transition/SlideChange][Start/End] transition events. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -716,10 +716,10 @@ Transition to the previous slide.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------------- | ---------------------- | ----------- |
|
||||
| `speed` | `number \| undefined` | |
|
||||
| `runCallbacks` | `boolean \| undefined` | |
|
||||
| Name | Type | Description |
|
||||
| -------------- | ---------------------- | ----------------------------------------------------------------------------------------------- |
|
||||
| `speed` | `number \| undefined` | The transition duration (in ms). |
|
||||
| `runCallbacks` | `boolean \| undefined` | If true, the transition will produce the [Transition/SlideChange][Start/End] transition events. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -733,11 +733,11 @@ Transition to the specified slide.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| -------------- | ---------------------- | ----------- |
|
||||
| `index` | `number` | |
|
||||
| `speed` | `number \| undefined` | |
|
||||
| `runCallbacks` | `boolean \| undefined` | |
|
||||
| Name | Type | Description |
|
||||
| -------------- | ---------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| `index` | `number` | The index of the slide to transition to. |
|
||||
| `speed` | `number \| undefined` | The transition duration (in ms). |
|
||||
| `runCallbacks` | `boolean \| undefined` | If true, the transition will produce [Transition/SlideChange][Start/End] transition events. |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -778,13 +778,14 @@ Type: `Promise<void>`
|
||||
|
||||
### `updateAutoHeight(speed?: number | undefined) => Promise<void>`
|
||||
|
||||
Force swiper to update its height (when autoHeight enabled) for the duration equal to 'speed' parameter
|
||||
Force swiper to update its height (when autoHeight is enabled) for the duration
|
||||
equal to 'speed' parameter.
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------- | --------------------- | ----------- |
|
||||
| `speed` | `number \| undefined` | |
|
||||
| Name | Type | Description |
|
||||
| ------- | --------------------- | -------------------------------- |
|
||||
| `speed` | `number \| undefined` | The transition duration (in ms). |
|
||||
|
||||
#### Returns
|
||||
|
||||
|
@ -161,7 +161,10 @@ export class Slides implements ComponentInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Force swiper to update its height (when autoHeight enabled) for the duration equal to 'speed' parameter
|
||||
* Force swiper to update its height (when autoHeight is enabled) for the duration
|
||||
* equal to 'speed' parameter.
|
||||
*
|
||||
* @param speed The transition duration (in ms).
|
||||
*/
|
||||
@Method()
|
||||
async updateAutoHeight(speed?: number) {
|
||||
@ -171,6 +174,10 @@ export class Slides implements ComponentInterface {
|
||||
|
||||
/**
|
||||
* Transition to the specified slide.
|
||||
*
|
||||
* @param index The index of the slide to transition to.
|
||||
* @param speed The transition duration (in ms).
|
||||
* @param runCallbacks If true, the transition will produce [Transition/SlideChange][Start/End] transition events.
|
||||
*/
|
||||
@Method()
|
||||
async slideTo(index: number, speed?: number, runCallbacks?: boolean) {
|
||||
@ -180,6 +187,9 @@ export class Slides implements ComponentInterface {
|
||||
|
||||
/**
|
||||
* Transition to the next slide.
|
||||
*
|
||||
* @param speed The transition duration (in ms).
|
||||
* @param runCallbacks If true, the transition will produce [Transition/SlideChange][Start/End] transition events.
|
||||
*/
|
||||
@Method()
|
||||
async slideNext(speed?: number, runCallbacks?: boolean) {
|
||||
@ -189,6 +199,9 @@ export class Slides implements ComponentInterface {
|
||||
|
||||
/**
|
||||
* Transition to the previous slide.
|
||||
*
|
||||
* @param speed The transition duration (in ms).
|
||||
* @param runCallbacks If true, the transition will produce the [Transition/SlideChange][Start/End] transition events.
|
||||
*/
|
||||
@Method()
|
||||
async slidePrev(speed?: number, runCallbacks?: boolean) {
|
||||
@ -225,7 +238,6 @@ export class Slides implements ComponentInterface {
|
||||
|
||||
/**
|
||||
* Get whether or not the current slide is the last slide.
|
||||
*
|
||||
*/
|
||||
@Method()
|
||||
async isEnd(): Promise<boolean> {
|
||||
@ -265,32 +277,38 @@ export class Slides implements ComponentInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock or unlock the ability to slide to the next slides.
|
||||
* Lock or unlock the ability to slide to the next slide.
|
||||
*
|
||||
* @param lock If `true`, disable swiping to the next slide.
|
||||
*/
|
||||
@Method()
|
||||
async lockSwipeToNext(shouldLockSwipeToNext: boolean) {
|
||||
async lockSwipeToNext(lock: boolean) {
|
||||
const swiper = await this.getSwiper();
|
||||
swiper.allowSlideNext = !shouldLockSwipeToNext;
|
||||
swiper.allowSlideNext = !lock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock or unlock the ability to slide to the previous slides.
|
||||
* Lock or unlock the ability to slide to the previous slide.
|
||||
*
|
||||
* @param lock If `true`, disable swiping to the previous slide.
|
||||
*/
|
||||
@Method()
|
||||
async lockSwipeToPrev(shouldLockSwipeToPrev: boolean) {
|
||||
async lockSwipeToPrev(lock: boolean) {
|
||||
const swiper = await this.getSwiper();
|
||||
swiper.allowSlidePrev = !shouldLockSwipeToPrev;
|
||||
swiper.allowSlidePrev = !lock;
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock or unlock the ability to slide to change slides.
|
||||
* Lock or unlock the ability to slide to the next or previous slide.
|
||||
*
|
||||
* @param lock If `true`, disable swiping to the next and previous slide.
|
||||
*/
|
||||
@Method()
|
||||
async lockSwipes(shouldLockSwipes: boolean) {
|
||||
async lockSwipes(lock: boolean) {
|
||||
const swiper = await this.getSwiper();
|
||||
swiper.allowSlideNext = !shouldLockSwipes;
|
||||
swiper.allowSlidePrev = !shouldLockSwipes;
|
||||
swiper.allowTouchMove = !shouldLockSwipes;
|
||||
swiper.allowSlideNext = !lock;
|
||||
swiper.allowSlidePrev = !lock;
|
||||
swiper.allowTouchMove = !lock;
|
||||
}
|
||||
|
||||
private async initSwiper() {
|
||||
|
Reference in New Issue
Block a user