继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

VUE多元素动画

会当凌绝顶聪明
关注TA
已关注
手记 240
粉丝 36
获赞 122

<!DOCTYPE html><html>    <head>        <meta charset="utf-8" />        <title>使用第三方动画_animate</title>        <link rel="stylesheet" type="text/css" href="css/animate.css">    </head>    <style type="text/css">        p{            width: 100px;            height: 100px;            background-color: grey;            margin: 20px auto;        }    </style>    <script type="text/javascript" src="js/vue.js" ></script>    <body>        <div id="div1">            <input type="text" v-model="name">            <!-- 多元素要用transition-group -->            <transition-group enter-active-class="animated fadeInLeft" leave-active-class="animated fadeOutRight">                <p v-for="(v,k) in arr2" :key="k" v-show="flag">                    {{v}}                </p>            </transition-group>        </div>    </body>    <script>        let vm = new Vue({            el: "#div1",            data: {                flag: true,                arr: ['tom','jack','mike','alice','mark','jhon'],                name: ''            },            computed: {                arr2:function(){                    var temp = [];                    this.arr.forEach(val => {                        if (val.includes(this.name)) {                            temp.push(val);                        }                    });                    return temp;                }            }        });    </script></html>

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP