在vue中使用animate.css
·
以前的使用方法改了,还是看了文档才知道怎么用
官网链接
当然vue有支持的动画,可自行翻越官网
这是在vue-cli项目中直接下载依赖,现在应该没有直接创建一个html文件的吧
控制台:npm install animate.css --save
main.js中:import animated from 'animate.css' … Vue.use(animated)
<template>
<div class="mainbox">
<transition
leave-active-class="animate__animated animate__fadeOutLeft"
enter-active-class="animate__animated animate__fadeInLeft"
mode="out-in"
>
<div class="main">
</div>
</transition>
</div>
</template>
animate__animated,以前是添加animate,现在是animate__animated
animate可以使用@keyframes
.my-element {
display: inline-block;
margin: 0 0.5rem;
animation: bounce; /* referring directly to the animation's @keyframe declaration */
animation-duration: 2s; /* don't forget to set a duration! */
}
更多推荐




所有评论(0)