Open baracuda69 opened 2 years ago
Even with adding said ts-file, it is not possible to do app..use(breadcrumbs)
Argument of type 'DefineComponent<{}, {}, any, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, ... 4 more ..., {}>' is not assignable to parameter of type 'Plugin_2'. Type 'DefineComponent<{}, {}, any, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, ... 4 more ..., {}>' is not assignable to type '{ install: PluginInstallFunction; }'.ts(2345)
Hello, Adam
Thank you for the comments. In future versions i will try to provide types. But for now you can create vendor.d.ts file near main.ts and add there declare module 'vue-3-breadcrumbs'
My project is in TypeScript, so the entry-point is main.ts (not main.js).
When trying to import breadcrumbs from 'vue-3-breadcrumbs'; I get an error: Could not find a declaration file for module 'vue-3-breadcrumbs'. '/node_modules/vue-3-breadcrumbs/dist/cjs/breadcrumbs.js' implicitly has an 'any' type.
Try
npm i --save-dev @types/vue-3-breadcrumbs
if it exists or add a new declaration (.d.ts) file containingdeclare module 'vue-3-breadcrumbs';
I have worked-around the issue by creating
/node-modules/vue-3-breadcrumbs/dist/cjs/breadcrumbs.d.ts file with the following content:
/ eslint-disable / declare module "vue-3-breadcrumbs" { import type { DefineComponent } from 'vue' const component: DefineComponent<{}, {}, any> export default component }
This should be pre-bundled :)
Cheers Adam