Complete the code to bind the dynamic component name.
<component :is="[1]"></component>
The :is attribute expects a variable holding the component name without quotes.
Complete the code to conditionally render a component using <template> and v-if.
<template v-if="[1] === 'UserProfile'"> <UserProfile /> </template>
The variable componentName holds the current component to render.
Fix the error in the dynamic component binding to avoid runtime error.
<component :is="[1]"></component>
When using ref in Vue 3, you must unwrap the value in the template automatically, so just use the variable name.
Fill both blanks to create a dynamic component with a fallback using <Suspense>.
<Suspense> <template #default> <component :is="[1]" /> </template> <template #fallback> <div>[2]</div> </template> </Suspense>
The :is binds to the variable holding the component name, and the fallback shows a loading message string.
Fill all three blanks to create a dynamic component with props and event binding.
<component :is="[1]" :title="[2]" @click="[3]" />
Bind the dynamic component name, pass the title prop, and attach the click event handler function.