NativeScript / nativescript-datetimepicker

Plugin with date and time picking fields
Apache License 2.0
27 stars 26 forks source link

"No Overload Matches this call" when doing Vue.use(DateTimePicker) in main.ts #71

Open Dobermensch opened 4 years ago

Dobermensch commented 4 years ago

I have a NS-Vue TS enabled project. I've installed the plugin using tns add plugin nativescript-datetimepicker. Now after installation, I go to the main.ts file to declare the plugin like so import DateTimePicker from "nativescript-datetimepicker/vue"; Vue.use(DateTimePicker); However I get swiggly red lines underneath 'DateTimePicker' in Vue.use(DateTimePicker).

I get the following error: Screen Shot 2020-08-08 at 2 15 36 PM

So I changed the file node_modules/nativescript-datetimepicker/vue/index.d.ts from export * from "./index"; to

// export * from "./index";

declare const DateTimePicker: {
  install(Vue: any, options: any): void;
};
export default DateTimePicker;

and now the swiggly red lines around Vue.use(DateTimePicker) are gone and I can build the project.