在Vue中使用animate.css

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>在Vue中使用animate.css</title>
<script src="./vue.js"></script>
<link rel="stylesheet" type="text/css" href="./Animate.css">
</head>
<body>
  <div id="root">
    <transition
    name="fade"
    enter-active-class="animated swing"
    leave-active-class="animated shake">
     <div v-if="show">hello world</div>
    </transition>
    <button @click="handleClick">切换</button>
   </div>
   <script>
    var vm=new Vue({
      el:'#root',
      data:{
        show:true
      },
      methods:{
        handleClick:function(){
          this.show=!this.show
        }
      }
    })
   </script>
</body>
</html>
posted @ 2019-12-20 10:58  嘘,在学习呢  阅读(540)  评论(0编辑  收藏  举报