Start your All-Access Pass to unlock this challenge
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