mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
@ -1,4 +1,4 @@
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, QueueApi, State } from '@stencil/core';
|
||||
import { Component, Element, Event, EventEmitter, Method, Prop, QueueApi, State, Watch } from '@stencil/core';
|
||||
|
||||
import { Gesture, GestureDetail } from '../../interface';
|
||||
|
||||
@ -47,6 +47,17 @@ export class ItemSliding {
|
||||
|
||||
@Prop({ context: 'queue' }) queue!: QueueApi;
|
||||
|
||||
/**
|
||||
* If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
*/
|
||||
@Prop() disabled = false;
|
||||
@Watch('disabled')
|
||||
disabledChanged() {
|
||||
if (this.gesture) {
|
||||
this.gesture.setDisabled(this.disabled);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emitted when the sliding position changes.
|
||||
*/
|
||||
@ -69,7 +80,7 @@ export class ItemSliding {
|
||||
onMove: this.onDragMove.bind(this),
|
||||
onEnd: this.onDragEnd.bind(this),
|
||||
});
|
||||
this.gesture.setDisabled(false);
|
||||
this.disabledChanged();
|
||||
}
|
||||
|
||||
componentDidUnload() {
|
||||
|
||||
@ -29,6 +29,24 @@ Options can be expanded to take up the full width of the item if you swipe past
|
||||
<!-- Auto Generated Below -->
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
||||
If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
#### disabled
|
||||
|
||||
boolean
|
||||
|
||||
If true, the user cannot interact with the sliding-item. Defaults to `false`.
|
||||
|
||||
|
||||
## Events
|
||||
|
||||
#### ionDrag
|
||||
|
||||
Reference in New Issue
Block a user