The Delightful World of Vue Part 2
Intro to CSS Transitions
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 2 / 2

Imagine I have this element in a template that I'm transitioning to fade in and out:

<template>
    <div :class="$style.component">
        <transition>
            <p v-show="showDisclaimer" class="transition-class">
                <strong>Disclaimer</strong>: Eating too much pizza can be
                bad for your health!
            </p>
        </transition>
    </div>
</template>

<style lang="scss" module>
.component :global {
    .transition-testing {
        transition: opacity 1s;
    }
}
</style>

When we transition an element's opacity and try to show or hide this element using v-show, our transition breaks as shown in the video. Why is this so?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.