简体   繁体   中英

Animate.css - Some animations not working

I'm trying to make dynamic transitions with Vue.js and Animate.css but some animations not working!

Animations that work: bounceIn , bounceOut and hinge .

I'm trying to do this on codepen.io but also tried on my PC and got the same.

Here is the code of the element I am trying to animate:

/* ... */
<transition
  name="custom-transition"
  mode="out-in"
  :enter-active-class="'animate_animated ' + enterClass"
  :leave-active-class="'animate_animated ' + leaveClass"
>
  <h1 v-if="show" :key="value">
    {{ value }}
  </h1>
</transition>
/* ... */

Values for enterClass and leaveClass are taken from here:

// ...
data: {
  show: true,
  enterClass: 'animate__bounceIn',
  enterAnimations: [
    'animate__backInDown',
    'animate__bounceIn',
    'animate__fadeIn',
    'animate__lightSpeedInRight',
    'animate__rotateIn',
    'animate__jackInTheBox',
    'animate__rollIn',
    'animate__zoomIn',
    'animate__slideInDown',
  ],
  leaveClass: 'animate__bounceOut',
  leaveAnimations: [
    'animate__backOutDown',
    'animate__bounceOut',
    'animate__fadeOut',
    'animate__lightSpeedOutLeft',
    'animate__rotateOut',
    'animate__hinge',
    'animate__rollOut',
    'animate__zoomOut',
    'animate__slideOutDown',
  ],
  value: 'Hi!',
}
// ...

Code on codepen.io

Okay, stupid mistake.. I just forgot the second underscore in class name animate__animated

<transition
  name="custom-transition"
  mode="out-in"
  :enter-active-class="'animate__animated ' + enterClass"
  :leave-active-class="'animate__animated ' + leaveClass"
>
  /*...*/
</transition>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM