美文网首页
03_06.自定义前缀

03_06.自定义前缀

作者: Robyn_Luo | 来源:发表于2017-11-14 19:26 被阅读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>
        <style>
            /* 隐藏动画样式 */
            .eee-leave {
                opacity: 1;
            }
            .eee-leave-to {
                opacity: 0;
            }
            .eee-leave-active {
                transition: all 3s;
            }
    
            /* 显示动画样式 */
            .zhang-enter {
                font-size: 100px;
            }
            .zhang-enter-to {
                font-size: 4px;
            }
            .zhang-enter-active {
                transition: all 1s;
            }
        </style>
    </head>
    <body>
        <div id="app">
            <!-- transtion标签有一个name属性, 可以用来自定义类名前缀 -->
            <transition name="eee">
                <p v-if="isShow">鹅鹅鹅</p>
            </transition>
            <p v-if="isShow">去想象体格</p>
            <p v-if="isShow">白毛浮绿水</p>
            <transition name="zhang">
                <p v-if="isShow">红掌拨青波</p>
            </transition>
            <button @click="change">显示隐藏</button>
        </div>
    
        <script src="vue.js"></script>
        <script>
            var vm = new Vue({
                el: '#app',
                data: {
                    isShow: true
                },
                methods: {
                    change: function() {
                        this.isShow = !this.isShow;
                    }
                }
            });
        </script>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:03_06.自定义前缀

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