vue学习笔记day19 动画之animate.css库使用

一 vue的过渡 (动画)
    2》利用css动画库 (animal.css)
    bower install animate.css

案例1

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<link rel="stylesheet" href="../animate.css">
<style>
    #box {
        width: 100px;
        height: 100px;
        background-color: red;
    }
</style>

<body>
    <div id="app">
        <button @click="show=!show">按钮</button>
        <transition enter-active-class="animated zoomInUp" leave-active-class="animated zoomOutUp">
            <div id="box" v-show="show"></div>
        </transition>

    </div>

    <script src="../vue.js"></script>
    <script>
        new Vue({
            el: "#app",

            data: {
                show: true,
            },
            methods: {

            }

        })
    </script>
</body>

</html>

 


版权声明:本文为weixin_39209728原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。