1. 创建组件
ionic g component myComponent
myComponent为组件名称
创建好后,生成的文件如下图
2. 在Page 中使用
使用的是home
在home.html加入
<ion-content padding> <my></my> </ion-content>
2.1 在home.module.ts中加入Components
2.2 或者在home.module.ts 的declarations中加入MyComponent
1. 创建组件
ionic g component myComponent
myComponent为组件名称
创建好后,生成的文件如下图
2. 在Page 中使用
使用的是home
在home.html加入
<ion-content padding> <my></my> </ion-content>
2.1 在home.module.ts中加入Components
2.2 或者在home.module.ts 的declarations中加入MyComponent
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。