vue中使用animate.css
乔文飞 Lv8

在vue项目中使用animate.css

配合vue中的transition标签来结合animate.css中的效果

  • npm install / yarn add 二选一

    1
    2
    yarn add animate.css@3.5.1
    # 在这要装3.5.1的版本,装了4.0之后的版本,会不生效。是版本兼容问题
  • main.js

    1
    2
    import animate from 'animate.css'
    Vue.use(animate);
  • component.vue

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <template>
    <div>
    <transition
    enter-active-class="animated bounceIn"
    leave-active-class="animated bounceOut"
    :duration="1000">
    <h3 v-show="show">这个元素存在动画效果</h3>
    </transition>
    <el-button @click="show=!show">开始表演</el-button>
    </div>
    <template>
  • 本文标题:vue中使用animate.css
  • 本文作者:乔文飞
  • 创建时间:2020-08-07 10:51:11
  • 本文链接:http://www.feidom.com/2020/08/07/vue中使用animateCss/
  • 版权声明:本博客所有文章为作者学习笔记,有转载其他前端大佬的文章。转载时请注明出处。