Complete the code to add a transition wrapper around the element.
<template> <[1] name="fade"> <p>Hello, Vue!</p> </[1]> </template>
div instead of transition.The <transition> component in Vue wraps elements to apply transitions smoothly.
Complete the code to bind the transition's appear attribute.
<template> <transition name="fade" [1]> <p>Welcome!</p> </transition> </template>
show or enter which are not valid here.The appear attribute makes the transition run when the component first appears.
Fix the error in the transition CSS class name for fade effect.
<style> .fade-[1] { transition: opacity 0.5s ease; opacity: 1; } </style>
leave-active for entering transition.active.The correct class for the transition phase is enter-active to apply the fade effect when entering.
Fill both blanks to create a fade-out transition with opacity and duration.
<style> .fade-[1] { opacity: 0; transition: opacity [2] ease; } </style>
enter-active instead of leave-active for fade-out.The leave-active class controls the fade-out effect, and 0.5s sets the transition duration.
Fill all three blanks to create a fade transition with appear attribute and CSS classes.
<template> <transition name="fade" [1]> <p v-if="show">Hello!</p> </transition> </template> <style> .fade-[2] { opacity: 0; transition: opacity [3] ease; } </style>
Use appear to animate on mount, leave-active for fade-out class, and 0.4s for smooth transition duration.