How to write a type for defineComponent? #10226
Unanswered
s3xysteak
asked this question in
Help/Questions
Replies: 1 comment
-
In Vue 3, the defineComponent function is used to define a component. To create a type for the return value of the defineComponent function, you can use the DefineComponent type provided by Vue. import { defineComponent, DefineComponent } from 'vue';
interface Returns {
com: DefineComponent;
}
function test(): Returns {
const com = defineComponent({}); //Add component options
return { com };
} I hope this is the answer you were hoping for! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For example:
Beta Was this translation helpful? Give feedback.
All reactions