Answer the question
In order to leave comments, you need to log in
How to type the returned component in Vue?
Good day.
I'm using Vue 3 + TS. There is a dynamic component and a function that returns multiple components.
currentComponent () {
if (someCondition) return componentA;
return componentB;
}
type AvailableComponents = typeof componentA | typeof componentB;
// хочется что-то вроде
type AvailableComponents = VueComponent
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question