简体   繁体   English

Object 文字可能只指定已知属性,并且“设置”类型中不存在“按钮”

[英]Object literal may only specify known properties, and 'buttons' does not exist in type 'Settings

I am using Angular 8 and following example fromhere but我正在使用 Angular 8 和以下示例

在此处输入图像描述

and the exception is例外是

在此处输入图像描述

Please help me solve this.请帮我解决这个问题。

Just make sure the dtOptions is declared as any .只需确保将dtOptions声明为any

You can find this comment on:https://l-lin.github.io/angular-datatables/#/extensions/buttons您可以在以下位置找到此评论:https://l-lin.github.io/angular-datatables/#/extensions/buttons

// Must be declared as "any", not as "DataTables.Settings"
dtOptions: any = {};

If the Type Settings has been defined by you or your team, you must add the buttons property as:如果您或您的团队已定义类型Settings ,则必须将buttons属性添加为:

buttons: any[];

Or或者

buttons?: any[];

To keep retro-compatibilty.保持复古兼容性。

If the type buttons has been defined by a third part library, instead, there's something wrong in the way you're using it and you should check the documentation to fix it.相反,如果类型buttons已由第三方库定义,则说明您使用它的方式有问题,您应该查看文档以修复它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对象字面量只能指定已知的属性,并且类型“设置”中不存在“选择” - Object literal may only specify known properties, and 'select' does not exist in type 'Settings' 错误TS2322:对象文字可能仅指定已知属性,并且类型中不存在“标签” - error TS2322: Object literal may only specify known properties, and 'labels' does not exist in type 对象文字只能指定已知的属性,并且'ChatMessage []'类型中不存在'message' - Object literal may only specify known properties and 'message' does not exist in type 'ChatMessage[]' 对象文字只能指定已知属性 - Object Literal May Only Specify Known Properties Angular Object文字只能指定知道属性,而...在类型中不存在 - Angular Object literal may only specify know properties and … does not exist in type 类型的参数不能分配给类型的参数。对象文字只能指定已知的属性 - Argument of type is not assignable to parameter of type .Object literal may only specify known properties 错误:对象字面量只能以角度指定已知属性 - error: Object literal may only specify known properties in angular 对象文字可能只指定已知属性错误 - Object literal may only specify known properties error angular 4 typescript 验证错误对象文字可能只指定已知属性 - angular 4 typescript validation error Object literal may only specify known properties 属性“对象的属性”在类型“对象”上不存在 - Property 'object's properties' does not exist on type 'Object'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM