问题
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