Is there a way that you can use transition
between vuejs conditionals v-if
and v-else
?
As an example:
<transition name="fade">
<p v-if="show">hello</p>
<p v-else>Goodbye</p>
</transition>
new Vue({
el: '#demo',
data: {
show: true
}
})
.fade-enter-active,
.fade-leave-active {
transition: opacity .5s
}
.fade-enter,
.fade-leave-active {
opacity: 0
}
I can't seem to get a transition
to work in such a scenario, where, as you toggle show
, the <p>
elements use a transition
between them.