1.安装node.js 和 ionic
https://nodejs.org/en/npm install -g Cordova ionic
2.创建第一个项目并启动
ionic start firstPage blank
cd firstPage
ionic serve
3.按钮button
https://ionicframework.com/docs/components/#buttons
1.在html文件中添加
<button ion-button round (click)="buttonClick()">Primary Round</button>
2.在typescript文件中添加函数
buttonClick(){// console.log("hello world");alert("hello world");
}
4.输入input
https://ionicframework.com/docs/api/components/input/Input/
1.在html文件中添加
<ion-list><ion-item><ion-label color="primary">Inline Label</ion-label><ion-input [(ngModel)]="inputVal" type="password"></ion-input></ion-item><ion-item><ion-textarea placeholder="Enter a description"></ion-textarea></ion-item></ion-list>
2.在typescript文件中声明和添加函数
public inputVal:string;buttonClick(){alert("this.inputVal");
}