mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
docs()item-sliding and lists
This commit is contained in:
@ -23,6 +23,8 @@ import {List} from '../list/list';
|
||||
* </ion-item>
|
||||
* </ion-list>
|
||||
* ```
|
||||
* @see {@link /docs/v2/components#lists List Component Docs}
|
||||
* @see {@link ../../list/List List API Docs}
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ion-item-sliding',
|
||||
@ -37,6 +39,9 @@ export class ItemSliding {
|
||||
elementRef.nativeElement.$ionSlide = ++slideIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
close() {
|
||||
this.list.closeSlidingItems();
|
||||
}
|
||||
|
@ -76,6 +76,22 @@ export class List extends Ion {
|
||||
this.itemTemplate = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable sliding items if your page has them
|
||||
*
|
||||
* ```ts
|
||||
* export class MyClass {
|
||||
* constructor(app: IonicApp){
|
||||
* this.app = app;
|
||||
* this.list = this.app.getComponent('my-list');
|
||||
* }
|
||||
* stopSliding(){
|
||||
* this.list.enableSlidingItems(false);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param {Boolean} shouldEnable whether the item-sliding should be enabled or not
|
||||
*/
|
||||
enableSlidingItems(shouldEnable) {
|
||||
if (this._enableSliding !== shouldEnable) {
|
||||
this._enableSliding = shouldEnable;
|
||||
@ -94,6 +110,23 @@ export class List extends Ion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable sliding items if your page has
|
||||
*
|
||||
* ```ts
|
||||
* export class MyClass {
|
||||
* constructor(app: IonicApp){
|
||||
* this.app = app;
|
||||
* this.list = this.app.getComponent('my-list');
|
||||
* }
|
||||
* // Here we have some method that will close the items
|
||||
* // when called
|
||||
* closeItmes(){
|
||||
* this.list.closeSlidingItems();
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
closeSlidingItems() {
|
||||
this.slidingGesture && this.slidingGesture.closeOpened();
|
||||
}
|
||||
|
Reference in New Issue
Block a user