When working with jsx, it is possible to store components in variables using syntax like
const comp=<p>Hello</p>
. This allows flexibility in rendering components by choosing which one to use.
I am curious if there is a similar capability in Vue. For example, if I have a template that looks like this:
<template>
<variable-comp />
</template>
I would like to dynamically change the content of variable-comp. While I know about v-if
and v-for
, they do not provide the same functionality.