在Vue中使用animate.css库(5-2)

在Vue中使用animate.css库

运用到animate.css的库,使用一定得添加animated这个类即可。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src='./vue.js'></script>
    <link rel="stylesheet" type="text/css" href="./animate.css">
    
</head>
<body>
    
    <div id="root">
        <transition 
            enter-active-class="animated swing"
            leave-active-class="animated shake"
        >
            <div v-show="show">hello world</div>
        </transition>
        <button @click="handleClick">toggle</button>
    </div>    

   <script>
       var vm = new Vue({
     
     
           el: '#root',
           data: {
     
     
               show: true
           },
           methods: {
     
     
               handleClick: function() {
     
     
                   this.show = !this.show
               }
           }
       })
      
    </script>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/weixin_45647118/article/details/114006657