[Vuejs]-How do I create a component instance programmatically in vue 3?

-3👍

The reason why it does not work is because your component has no real constructor or class. Therefore, you cannot create an instance of this component.

But there is a workaround for that.

const TooltipClass = Vue.extend(tooltip);
const tooltipInstance = new TooltipClass()

Vue.extend creates a subclass of the Vue constructor.

Hope this helps!

👤FloWy

Leave a comment