600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > ionic开发的过程中遇到的问题及解决方法的整理(七)——多图放大预览可左右滑动

ionic开发的过程中遇到的问题及解决方法的整理(七)——多图放大预览可左右滑动

时间:2018-07-07 07:40:02

相关推荐

ionic开发的过程中遇到的问题及解决方法的整理(七)——多图放大预览可左右滑动

1.插件安装

npm install ionic-gallery-modal --save

2.在app.module.ts引入

import * as ionicGalleryModal from 'ionic-gallery-modal';import { HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';imports: [//...ionicGalleryModal.GalleryModalModule,//...],providers: [//...{provide: HAMMER_GESTURE_CONFIG,useClass: ionicGalleryModal.GalleryModalHammerConfig,},//...],

3.在对应的组建ts中使用

private photos: any[] = [];showbigpicture(pirtrue, num) {let photos = [{url:'http:xxxxxxx .png' , title:'xxx'},{url:'http:xxxxxxx .png' , title:'xxx'},{url:'http:xxxxxxx .png' , title:'xxx'},]//此处photos换成自己需要的路径let modal = this.modalCtrl.create(GalleryModal, {photos: photos ,initialSlide: num, // The second image});modal.present();}

到这基本就可以使用了(有帮助的话,点个赞哟(⊙o⊙)…)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。