I install vue using the cli v4.4.1.
After that I run this command to update to Vue3: vue add vue-next
.
And when I open main.ts
I get typescript error:
Argument of type 'typeof import("c:/../vue-app/node_modules/vue/dist/vue")' is not assignable to parameter of type 'PublicAPIComponent'.
What I need to do to solve this error?
I solved the issue by updating the definition file for *.vue modules in src/shims-vue.d.ts
with the following:
declare module "*.vue" {
import { defineComponent } from "vue";
const component: ReturnType<typeof defineComponent>;
export default component;
}
source: https://dev.to/lmillucci/building-a-vue-3-component-with-typescript-4pge
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With