Answer the question
In order to leave comments, you need to log in
Why doesn't enter transition work the first time?
Weird shit is happening.
I have an element that I want to animate
<transition name="cc">
<span v-if="typeAnimated" class="cc-type" :style="typeStyle"></span>
</transition>
ccType (type) {
if (type === 'amex' || type === 'dankort' || type === 'diners' || type === 'discover' || type === 'jcb' || type === 'mastercard' || type === 'visa') {
this.type = type
let ccTypeImage = require(`assets/images/${this.type}.svg`)
if (ccTypeImage) {
this.typeStyle = `background-image: url(${ccTypeImage})`
this.typeAnimated = true
}
} else {
this.type = false
this.typeAnimated = false
}
}
.cc-enter-active, .cc-leave-active
transition: opacity 300ms, transform 300ms
.cc-enter, .cc-leave-to
opacity: 0
transform: translateX(10%)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question