一、alert组件
# tab2.page.html<ion-content> <ion-button color="primary" (click)="presentAlert()">Primary</ion-button></ion-content># tab2.page.tsexport class Tab2Page { constructor(public alertController: AlertController) {} async presentAlert() { const alert = await this.alertController.create({ header: 'Alert', subHeader: 'Subtitle', message: 'This is an alert message.', buttons: ['OK'] }); await alert.present(); }}
二、修改工具栏颜色
<ion-toolbar color="success"> <ion-title> Tab One </ion-title></ion-toolbar>
三、修改返回按钮文字
//app.module.ts中配置@NgModule({ ... imports: [IonicModule.forRoot({ backButtonText:"返回" })],})export class AppModule {}