Open SanUsmanAli opened 3 years ago
Thank you, do you think you can update the function definition to match the plugin API for typescript to be happy ?
Hi @guillaumevincent, I am not much fimilar with Vue.Js and Typescript.Js so it will be difficult for me to update the function definition. Can you please help us in this situation OR you can guide us please. It will be helpful.
Any help will be appreciated.
Hi @ALL,
I am using vue-polyglot library. I have tested it in core vue application and there it was working fine. As soon as I install it in my typescript application it started giving me error.
16:9 No overload matches this call. Overload 1 of 2, '(plugin: PluginObject<{ defaultLanguage: string; languagesAvailable: string[]; }> | PluginFunction<{ defaultLanguage: string; lang uagesAvailable: string[]; }>, options?: { ...; } | undefined): VueConstructor<...>', gave the following error. Argument of type '{ name: string; components: { [x: number]: any; }; data(): { msg: string; }; }' is not assignable to parameter of type 'PluginOb ject<{ defaultLanguage: string; languagesAvailable: string[]; }> | PluginFunction<{ defaultLanguage: string; languagesAvailable: string[]; }>'. Property 'install' is missing in type '{ name: string; components: { [x: number]: any; }; data(): { msg: string; }; }' but required in type 'Plu ginObject<{ defaultLanguage: string; languagesAvailable: string[]; }>'. Overload 2 of 2, '(plugin: PluginObject | PluginFunction, ...options: any[]): VueConstructor', gave the following error. Argument of type '{ name: string; components: { [x: number]: any; }; data(): { msg: string; }; }' is not assignable to parameter of type 'PluginOb ject | PluginFunction'. Property 'install' is missing in type '{ name: string; components: { [x: number]: any; }; data(): { msg: string; }; }' but required in type 'Plu ginObject'. 14 | const authService = new AuthService(); 15 |
16 | Vue.use(Polyglot, { | ^ 17 | defaultLanguage: 'en', 18 | languagesAvailable: [ 'fr', 'es', 'zh' ], 19 | });