Complete the code to wrap the element with a Vue transition component.
<template> <[1] name="fade"> <p v-if="show">Hello Vue!</p> </[1]> </template>
The transition component in Vue is used to apply enter and leave transitions to elements or components.
Complete the code to bind the transition's CSS class name.
<template> <transition name="[1]"> <div v-if="visible">Content</div> </transition> </template>
The name attribute sets the base CSS class for the transition. Here, fade is commonly used for fade-in and fade-out effects.
Fix the error in the transition event listener syntax.
<template> <transition @[1]="onEnter"> <div v-if="show">Hello</div> </transition> </template>
The correct event name for the hook before the enter transition starts is before-enter.
Fill both blanks to create a fade transition with correct CSS classes.
<style> .[1]-enter-active, .[1]-leave-active { transition: opacity 0.5s; } .[2]-enter-from, .[2]-leave-to { opacity: 0; } </style>
The CSS classes must match the transition name attribute, here 'fade', to apply the fade effect correctly.
Fill all three blanks to create a transition with a custom JavaScript hook.
<template>
<transition
@[1]="beforeEnter"
@[2]="enter"
@[3]="leave"
>
<div v-if="show">Content</div>
</transition>
</template>Vue transition events include before-enter, enter, and leave for hooking into different phases of the transition.