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

僤鯓⒐⒋嵵緔 提交于 2021-02-16 20:10:18

问题


I am using Angular 8 and following example from here but

and the exception is

Please help me solve this.


回答1:


Just make sure the dtOptions is declared as any.

You can find this comment on: https://l-lin.github.io/angular-datatables/#/extensions/buttons

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



回答2:


If the Type Settings has been defined by you or your team, you must add the buttons property as:

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.



来源:https://stackoverflow.com/questions/58372987/object-literal-may-only-specify-known-properties-and-buttons-does-not-exist-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!