本文整理匯總了TypeScript中ionic-angular.Slides.slideTo方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Slides.slideTo方法的具體用法?TypeScript Slides.slideTo怎麽用?TypeScript Slides.slideTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ionic-angular.Slides
的用法示例。
在下文中一共展示了Slides.slideTo方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: goToSlide
goToSlide(str) {
let user = this.users[this.slides.getActiveIndex()];
let index = this.slides.getActiveIndex();
if (str == 'like') {
let params = JSON.stringify({
toUser: user.id,
});
this.http.post(this.api.url + '/user/like/' + user.id, params, this.api.setHeaders(true)).subscribe(data => {
});
this.users.splice(index, 1);
this.slides.slideTo(index,1);
} else {
if (this.slides.isEnd()) {
//this.slides.slideNext();
//var that = this;
//setTimeout(function () {
this.slides.slideTo(0,1);
//this.slides.update();
//}, 10);
} else {
this.slides.slideNext();
}
}
}
示例2: Date
this.platform.registerBackButtonAction(() => {
if (this.isMessagesOpened) {
this.isMessagesOpened = false;
return;
}
if (this.navPath.length < 1) {
if (new Date().getTime() - lastTimeBackPress < timePeriodToExit) {
this.platform.exitApp();
} else {
let toast = this.toastCtrl.create({
message: 'Press back again to exit',
duration: 3000,
position: 'bottom'
});
toast.present();
lastTimeBackPress = new Date().getTime();
}
return;
}
this.navPath.pop();
this.slide = this.navPath[this.navPath.length - 1];
this.slides.slideTo(this.slide);
this.isGoingBack = true;
});
示例3: switchSlide
switchSlide(index) {
this.slide = index;
this.slides.slideTo(index);
if (this.isMessagesOpened) {
this.isMessagesOpened = false;
}
}
示例4: ionViewDidEnter
/**
* This method will be invoked everytime when come back.
*/
public ionViewDidEnter(): void {
// Just set it again. <!! DO NOT REMOVE THIS LINE !!>
this.selectedVehicle = this.appState.userSelectedVehicle;
if (this.userVehicleList && this.userVehicleList.length && this.selectedVehicle) {
// This will make Slides move to Selected vehicle.
const vehicleIndex = this.userVehicleList.indexOf(this.selectedVehicle);
this.vehicleSlide.slideTo(vehicleIndex || 0);
}
}
示例5: switchSlide
switchSlide(index) {
this.slides.lockSwipes(false);
this.slides.slideTo(index);
}