zoukankan      html  css  js  c++  java
  • Vue使用animate.js

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>使用animate.js</title>
        <script src="../js/vue.js"></script>
        <!--animate,js官网:https://daneden.github.io/animate.css/-->
        <link rel="stylesheet" type="text/css" href="../css/animate.css">
        <style>
            @keyframes bounce-in {
                0%{
                    transform: scale(0);
                }
                50%{
                    transform: scale(1.5);
                }
                100%{
                    transform: scale(1);
                }
            }
            .active{
                transform-origin: left center;
                animation: bounce-in 1s;
            }
            .leave{
                transform-origin: left center;
                animation: bounce-in 1s reverse;
            }
        </style>
    </head>
    <body>
    <div id="app">
        <!--自定义过渡类名
            enter-class
            enter-active-class
            enter-to-class (2.1.8+)
            leave-class
            leave-active-class
            leave-to-class (2.1.8+)
        -->
        <button @click="btnClick">change</button>
        <transition
            name="fade"
            enter-active-class="active"
            leave-active-class="leave"
        >
            <div v-if="show">hello</div>
        </transition>
        <hr>
        <transition
                name="fade2"
                enter-active-class="animated swing"
                leave-active-class="animated shake"
        >
            <div v-if="show">hello</div>
        </transition>
    </div>
    <script>
        vm = new Vue({
            el: '#app',
            data: {
                show:true
            },
            methods:{
                btnClick:function () {
                    this.show = !this.show
                }
            }
        })
    </script>
    </body>
    </html>
  • 相关阅读:
    预备作业03
    预备作业02
    预备作业01
    20162319莫礼钟 2016-2017-2 《程序设计与数据结构》第1周学习总结
    预备作业03
    20162319 莫礼钟 预备作业02
    20162319莫礼钟 预备作业01
    20162307 实验一 实验报告
    20162307 第4周学习总结
    20162307 第3周学习总结
  • 原文地址:https://www.cnblogs.com/fly-book/p/12017295.html
Copyright © 2011-2022 走看看