Ionic5工程升级到Ionic7碰到的一些问题及解决方法
kelvin 发布于 2024-07-07

1、Object literal may only specify known properties, and 'entryComponents' does not exist in type 'NgModule'.

app.module.ts中的

@NgModule({ declarations: [AppComponent], entryComponents: [ ],

将entryComponents去掉

2、angular - Property 'modal' comes from an index signature, so it must be accessed with

this.navParams.data.modal.dismiss({ 'name': name1, });

改为

this.navParams.data['modal'].dismiss({ 'name': name1, });

 

3、TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string'

this.str = this.activatedRoute.snapshot.paramMap.get('xx');

改为

this.str = this.activatedRoute.snapshot.paramMap.get('xx')||'';

 

str:string;

改为str?:string

 

 

kelvin
关注 私信
文章
92
关注
0
粉丝
0