Make quasar components compatible with volar #10619
Replies: 4 comments 7 replies
-
This will help a lot of people. Do you know why this is still necessary for Quasar components ? Is it because Quasar (v2) has not been rewritten in Typescript unlike Vue3 itself? |
Beta Was this translation helpful? Give feedback.
-
I was playing around with it earlier, and here is my solution: import { DefineComponent, ComponentPublicInstance } from 'vue';
import { QBtn, /* ... */ } from 'quasar';
declare module 'vue' {
export interface GlobalComponents {
QBtn: DefineComponent<Omit<QBtn, keyof ComponentPublicInstance>>;
// ...
}
}
export {}; This solution is simpler and maybe even safer because there are also some properties/methods that are not prefixed with |
Beta Was this translation helpful? Give feedback.
-
Maybe some inspiration vuejs/language-tools#418 (comment) |
Beta Was this translation helpful? Give feedback.
-
#10839 is merged. The next release will provide Volar support out of the box, with a bonus: event auto-completion support 🚀 |
Beta Was this translation helpful? Give feedback.
-
For anyone coming here to make quasar components compatible with volar paste this in
component.d.ts
a small script for this is
Beta Was this translation helpful? Give feedback.
All reactions