简体   繁体   中英

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

在此处输入图像描述

and the exception is

在此处输入图像描述

Please help me solve this.

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 = {};

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM