ionic stepper
release: 1.1.0
离子的草原组件。
中文读书我
ionic-angular: ^3.x@angular/animations: ^4.x $ npm install ionic-stepper
# or
$ yarn add ionic-stepper
在your-root.module.ts中导入
import { BrowserModule } from '@angular/platform-browser' ;
import { BrowserAnimationsModule } from '@angular/platform-browser/animations' ;
import { ErrorHandler , NgModule } from '@angular/core' ;
import { IonicApp , IonicErrorHandler , IonicModule } from 'ionic-angular' ;
...
import { IonicStepperModule } from 'ionic-stepper' ;
@ NgModule ( {
...
imports : [
BrowserModule ,
BrowserAnimationsModule ,
IonicStepperModule ,
IonicModule . forRoot ( MyApp )
] ,
...
} )
export class AppModule { } your-component.ts
import { Component } from '@angular/core' ;
import { NavController } from 'ionic-angular' ;
@ Component ( {
selector : 'page-home' ,
template : `
<ion-stepper #stepper (selectIndexChange)="selectChange($event)">
<ion-step label="Step1"
description="Step1 description">
<h2>Step1 Content</h2>
<p>Step1 Content</p>
<button ion-button small ionicStepperNext>Next</button>
</ion-step>
<ion-step label="Step2 - Step2 - Step2"
description="Step1 description">
<h2>Step2 Content</h2>
<p>Step2 Content</p>
<button ion-button color="light" small ionicStepperPrevious>Previous</button>
</ion-step>
</ion-stepper>
`
} )
export class HomePage {
constructor ( public navCtrl : NavController ) { }
selectChange ( e ) {
console . log ( e ) ;
}
} ion-stepper | 姓名 | 类型 | 默认 | 描述 |
|---|---|---|---|
| [模式] | 'horizontal', 'vertical' | 'vertical' | 方向 |
| (SelectIndexChange) | EventEmitter<number> | 索引更改事件 |
| 姓名 | 描述 |
|---|---|
| NextStep():void | 下一步 |
| 上一个():void | 上一步 |
| SetStep(索引:编号):布尔值 | 设置索引 |
ion-step | 姓名 | 类型 | 默认 | 描述 |
|---|---|---|---|
| [标签] | string | 步骤标签 | |
| [描述] | string | 步骤描述(仅可见垂直模式) | |
| [图标] | icon | 'number' | 步骤图标,默认显示索引(图标) |
| [地位] | 'error', '' | '' | 步骤状态 |
| [erroricon] | string | 'close' | 错误状态图标 |
[ionicStepperNext]搬到步进的下一步
<button ion-button ionicStepperNext>Next</button>
[ionicStepperPrevious]搬到步进的前一步
<button ion-button ionicStepperPrevious>Previous</button>
该项目是根据MIT许可证获得许可的 - 有关详细信息,请参见许可证文件