0、新建页面ionic g page pages/~~~~
1、ion-refresher要放在下边否则无效
complete()前要加target不然不会停止刷新动画
</ion-segment>
<ion-content>
<ion-refresher slot="fixed" (ionRefresh)="refresh(activeName,$event)" pullMax="1000">
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
componentEvent.target.complete();
2、跳转页面及传参
ionic3: this.navCtrl.push(VerifyPage, { type: 1, amout: this.amout, bankcard_id1: this.bankcard_id1 });
ionic4: this.navCtrl.navigateForward([‘verify’], { queryParams: { type: 1, amout: this.amout, bankcard_id1: this.bankcard_id1 } })
ionic3:
public params: NavParams,
this.type = params.get(“type”);
ionic4:
public route: ActivatedRoute,
this.route.queryParams.subscribe((info) => {
this.type = info.type; })
3、ionic3:this.viewCtrl.dismiss()
ionic4: this.navCtrl.pop()
4、弹窗模态框等要用async方法
await this.alertCtrl.create({
header: “……”,//不是title了
await alert.present();
5、ionViewDidLoad没了,,对应方法考虑写到ngOnInit或ionViewDidEnter里
6、样式colorr:#fff无效的话试试这样写–color:#fff
修改样式注意看文档~