mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
docs()item-sliding and lists
This commit is contained in:
@ -23,6 +23,8 @@ import {List} from '../list/list';
|
|||||||
* </ion-item>
|
* </ion-item>
|
||||||
* </ion-list>
|
* </ion-list>
|
||||||
* ```
|
* ```
|
||||||
|
* @see {@link /docs/v2/components#lists List Component Docs}
|
||||||
|
* @see {@link ../../list/List List API Docs}
|
||||||
*/
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-item-sliding',
|
selector: 'ion-item-sliding',
|
||||||
@ -37,6 +39,9 @@ export class ItemSliding {
|
|||||||
elementRef.nativeElement.$ionSlide = ++slideIds;
|
elementRef.nativeElement.$ionSlide = ++slideIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
close() {
|
close() {
|
||||||
this.list.closeSlidingItems();
|
this.list.closeSlidingItems();
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,22 @@ export class List extends Ion {
|
|||||||
this.itemTemplate = item;
|
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) {
|
enableSlidingItems(shouldEnable) {
|
||||||
if (this._enableSliding !== shouldEnable) {
|
if (this._enableSliding !== shouldEnable) {
|
||||||
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() {
|
closeSlidingItems() {
|
||||||
this.slidingGesture && this.slidingGesture.closeOpened();
|
this.slidingGesture && this.slidingGesture.closeOpened();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user