New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No support for combination of Nuxt 2 and vue-class-component? #1061
Comments
Maybe this thread help you: #750 (comment) |
Very helpful @johnsoncodehk, I will try that. Will this work with globally defined components at all (i.e. To clarify: I don't mind creating definition files or anything. But when I had a file as docs suggested it was not doing anything whatsoever. Components were still showing as |
I have updated the example repository with a definition file that should work (my understanding) but does not. https://github.com/barfurth/volar-no-types-repro/blob/main/components.d.ts Usage happens here: https://github.com/barfurth/volar-no-types-repro/blob/main/pages/index.vue With the above example repository, the type of the |
Thank you @johnsoncodehk, it appears prop type checking with global components is working properly now. Sadly your link to #750 (comment) does not work fully anymore. It seems the type of export default class Foo extends Vue {
$emit!: {
(e: 'my-event-1'): void
(e: 'my-event-2', arg1: string, arg2: number): void
}
} This results in an error:
Thank you for your quick support with the issue. :) |
I'm actually somewhat confused right now. I am using Volar in a Vue 2 / Nuxt 2 + TypeScript project. I've installed
@vue/runtime-dom
and built-in components work just fine. Components are written in class style with property decorators.There seem to be a number of issues (closed) suggesting various things to get this working but I haven't found a way. I have created a minimal reproduction repository here: https://github.com/barfurth/volar-no-types-repro
Namely I have tried things suggested here with no success:
My question can be boiled down to: What is the definitive way to get prop and event type checking (aka. types in templates) working when using Vue 2, vue-property-decorator and vue-class-component. I feel like I have tried everything that has been suggested without any luck.
The text was updated successfully, but these errors were encountered: