<!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" class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="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>
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦