美文网首页
03_09.vue中使用animate库

03_09.vue中使用animate库

作者: Robyn_Luo | 来源:发表于2017-11-14 19:34 被阅读0次
    <!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>
        <link rel="stylesheet" href="animate.css">
    </head>
    <body>
        <div id="app">
            <!-- transition有6个特殊属性, 可以让我们自定义类名, 主要是配合第三方类库使用  -->
            <transition enter-active-class="animated bounce" leave-active-class="animated lightSpeedOut">
                <p v-if="isShow">我想买房子</p>
            </transition>
            
            <transition enter-active-class="animated lightSpeedIn" leave-active-class="animated lightSpeedOut">
                <p v-if="isShow">另外还想要辆车</p>
            </transition>
    
            <button @click='change'>显示隐藏</button>
        </div>
    
        <script src="vue.js"></script>
        <script>
            new Vue({
                el: '#app',
                data: { isShow: true },
                methods: {
                    change() {
                        this.isShow = !this.isShow;
                    }
                }
            });
        </script>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:03_09.vue中使用animate库

          本文链接:https://www.haomeiwen.com/subject/asofvxtx.html