Created
October 18, 2016 12:58
-
-
Save keysona/9515cbcc365b7708c34b3d64d946ea23 to your computer and use it in GitHub Desktop.
Ionic2-Slides-创造图片滑动栏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| import { NavController } from 'ionic-angular'; | |
| @Component({ | |
| selector: 'page-component', | |
| templateUrl: ` | |
| <ion-header> | |
| <ion-navbar> | |
| <ion-title text-center> | |
| Text | |
| </ion-title> | |
| </ion-navbar> | |
| </ion-header> | |
| <ion-content> | |
| <ion-slides [options]="mySlideOptions"> | |
| <ion-slide style="background-color: #2196F3">Blue</ion-slide> | |
| <ion-slide style="background-color: #3F51B5">Indigo</ion-slide> | |
| <ion-slide style="background-color: #673AB7">Deep Purple</ion-slide> | |
| </ion-slides> | |
| </ion-content> | |
| ` | |
| }) | |
| export class HomePage { | |
| mySlideOptions = { | |
| pager: true, | |
| initialSlide: 0, | |
| autoplay: 1000, // 1000 代表播放间隔是1秒。以毫秒为单位。 | |
| loop: true | |
| }; | |
| constructor(public navCtrl: NavController) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment