Mat*_*s.h 3 cordova ionic-framework ionic3 angular
嗨,我是 Ionic 的新手,当我想创建新的加载屏幕时出现此错误。
Argument of type '{ content: string; }' is not assignable to parameter
of type 'LoadingOptions'.
Object literal may only specify known properties, and 'content' does not exist in type 'LoadingOptions'.
Run Code Online (Sandbox Code Playgroud)
我看到文档,我认为语法很好。
const loading = await this.loadingController.create({
content: 'Please wait...',
});
await loading.present();
Run Code Online (Sandbox Code Playgroud)
看起来他们的文档已经过时了,这是他们代码中的接口定义:
https://github.com/ionic-team/ionic/blob/master/core/src/components/loading/loading-interface.ts
export interface LoadingOptions {
spinner?: SpinnerTypes | null;
message?: string;
cssClass?: string | string[];
showBackdrop?: boolean;
duration?: number;
translucent?: boolean;
animated?: boolean;
mode?: Mode;
keyboardClose?: boolean;
id?: string;
enterAnimation?: AnimationBuilder;
leaveAnimation?: AnimationBuilder;
}
Run Code Online (Sandbox Code Playgroud)
如您所见,content
不再存在,它已重命名为message
.
归档时间: |
|
查看次数: |
2348 次 |
最近记录: |