First install the animate.css class library
cnpm install animate.css –save
Then reference it in the script file of vue
import $ from '../assets/js/jquery.js';//非必要
import animate from 'animate.css'\
The method of use is as follows
-
//Use duration to uniformly set the animation when entering and leaving the market
-
//You can also set separately: duration="{enter:200,leave:400}"
-
<transition name="fade" enter-active-class="animated bounceIn"
-
leave-active-class="animated bounceIn"
-
:duration="200">
-
<h3 v- if =" flag ">This is an h3</h3>
-
</transition>
-
fade: {
-
title: 'Fade in and out',
-
fadeIn: 'Fade in',
-
fadeInDown: 'Fade down',
-
fadeInDownBig: 'Fade down fast',
-
fadeInLeft: 'Fade in to the right',
-
fadeInLeftBig: 'Fade in fast to the right',
-
fadeInRight: 'Fade in to the left',
-
fadeInRightBig: 'Fade in fast to the left',
-
fadeInUp: 'Fade up',
-
fadeInUpBig: 'Fade up fast',
-
fadeOut: 'Fade out',
-
fadeOutDown: 'Fade down',
-
fadeOutDownBig: 'Fade down quickly',
-
fadeOutLeft: 'Fade to the left',
-
fadeOutLeftBig: 'Fade out quickly to the left',
-
adeOutRight: 'Fade out right',
-
fadeOutRightBig: 'Fade out fast to the right',
-
fadeOutUp: 'Fade up',
-
fadeOutUpBig: 'Fade up fast'
-
},
-
bounce: {
-
title: 'Bounce Class',
-
bounceIn: 'Bounce into',
-
bounceInDown: 'Bounce down to enter',
-
bounceInLeft: 'Bounce to the right to enter',
-
bounceInRight: 'Bounce left to enter',
-
bounceInUp: 'Bounce up to enter',
-
bounceOut: 'Bounce out',
-
bounceOutDown: 'Bounce down to exit',
-
bounceOutLeft: 'Bounce to the left to exit',
-
bounceOutRight: 'Bounce to the right to exit',
-
bounceOutUp: 'Bounce up to exit'
-
},
-
zoom: {
-
title: 'Zoom class',
-
zoomIn: 'Zoom in',
-
zoomInDown: 'Zoom down to enter',
-
zoomInLeft: 'Zoom in to the right',
-
zoomInRight: 'Zoom in to the left',
-
zoomInUp: 'Zoom up to enter',
-
zoomOut: 'Zoom out',
-
zoomOutDown: 'Zoom down to exit',
-
zoomOutLeft: 'Zoom to the left to exit',
-
zoomOutRight: 'Zoom to the right to exit',
-
zoomOutUp: 'Zoom up to exit'
-
},
-
rotate: {
-
title: 'Rotation class',
-
rotateIn: 'Rotate clockwise into',
-
rotateInDownLeft: 'Rotate from left to bottom',
-
rotateInDownRight: 'Rotate from right to bottom',
-
rotateInUpLeft: 'Rotate from left to top',
-
rotateInUpRight: 'Rotate from right to up',
-
rotateOut: 'Rotate clockwise to exit',
-
rotateOutDownLeft: '向左下旋出',
-
rotateOutDownRight: '向右下旋出',
-
rotateOutUpLeft: '向左上旋出',
-
rotateOutUpRight: '向右上旋出'
-
},
-
flip: {
-
title: '翻转类',
-
flipInX: '水平翻转进入',
-
flipInY: '垂直翻转进入',
-
flipOutX: '水平翻转退出',
-
flipOutY: '垂直翻转退出'
-
},
-
strong: {
-
title: '强调类',
-
bounce: '弹跳',
-
flash: '闪烁',
-
pulse: '脉冲',
-
rubberBand: '橡皮筋',
-
shake: '左右弱晃动',
-
swing: '上下摆动',
-
tada: '缩放摆动',
-
wobble: '左右强晃动',
-
jello: '拉伸抖动'
-
}