本文整理匯總了TypeScript中ionic-angular/gestures/gesture.Gesture類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Gesture類的具體用法?TypeScript Gesture怎麽用?TypeScript Gesture使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Gesture類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: ngOnInit
ngOnInit() {
this.pressGesture = new Gesture(this.el);
this.pressGesture.listen();
this.pressGesture.on('press', e => {
let actionSheet = ActionSheet.create({
title: 'Modify your album',
buttons: [
{
text: 'Delete',
role: 'destructive',
icon: 'trash',
handler: () => {
// console.log(this.el.textContent.trim());
console.log(this.obj);
console.log(Games.find({ _id: this.obj }).fetch());
// console.log(Lists.find({ _id: this.obj }).length>0);
if (Games.find({ _id: this.obj }).fetch().length > 0)
console.log(Games.remove({ _id: this.obj }));
// else if (ShoppingLists.find({ _id: this.obj }).fetch().length > 0)
// console.log(ShoppingLists.remove({ _id: this.obj }));
}
}, {
text: 'Cancel',
role: 'cancel',
cssClass: 'redd',
handler: () => {
console.log('Cancel clicked');
}
}
],
});
this.nav.present(actionSheet);
})
}
示例2: ngOnInit
ngOnInit() {
this.swipeGesture = new Gesture(this.el, {
recognizers: [
[Hammer.Swipe, {direction: Hammer.DIRECTION_VERTICAL}]
]
});
this.swipeGesture.listen()
this.swipeGesture.on('swipeup', e => {
this.actionUp()
})
this.swipeGesture.on('swipedown', e => {
this.actionDown()
})
}
示例3: ngOnInit
ngOnInit() {
this.swipeGesture = new Gesture(this.el, {
recognizers: [
[Hammer.Swipe, {direction: Hammer.DIRECTION_VERTICAL}]
]
});
this.swipeGesture.listen();
this.swipeGesture.on('swipeup', e => {
console.log('swipeup!!');
this.events.publish('event:swipe','up');
})
this.swipeGesture.on('swipedown', e => {
console.log('swipedown!!');
this.events.publish('event:swipe','down');
})
}
示例4: ngOnDestroy
ngOnDestroy() {
this.pressGesture.destroy();
}
示例5: ngOnDestroy
ngOnDestroy() {
this.swipeGesture.destroy()
}