Open AHoxha19 opened 6 years ago
We are also using Aurelia and we had to modify the perfect-scrollbar.d.ts to get this to work.
We removed the export default PerfectScrollbar
line and replace it with an export = PerfectScrollbar
above the declare class PerfectScrollbar
eg.
export = PerfectScrollbar;
declare class PerfectScrollbar {
constructor(element: string | HTMLElement, options?: PerfectScrollbar.Options);
This also meant that we need needed to change the import statement to this: import * as PerfectScrollbar from 'perfect-scrollbar';
I hope this helps. I'm not sure if this is a valid change for use in other frameworks but it is now working for us.
Update: With the above changes in place we also found that on a release build with webpack we needed to remove the "module" property from package.json file to force webpack to use 'dist/perfect-scrollbar.common.js'
I am trying to use the plugin with the aurelia framework but i always got this TypeScript error:
When i import the plugin like this:
it works but TypeScript always give me this error:
If i import the plugin like it's written in the doc:
I don't have the error in TypeScript but the plugin is not working.
I tried many ways to initialize and import it but it still does not work. Has anyone an idea ?
Config: I use Aurelia, Aurelia CLI and RequireJS as a loader.