标签:切换 method function div fun script back rip hand
<transition name=‘fade‘> <div v-if=‘show‘>hello world</div> </transition>
<style> .fade-enter{ opacity: 0; } .fade-enter-active{ transition: opacity 3s; } </style> <div id=‘app‘> <transition name=‘fade‘> <div v-if=‘show‘>hello world</div> </transition> <button @click=‘handleClick‘>切换</button> </div> <script> var vm = new Vue({ el:‘#app‘, data:{ show:true }, methods:{ handleClick:function(){ this.show = !this.show; } } }) </script>
<style> .v-enter{ opacity: 0; } .v-enter-active{ transition: opacity 3s; } .v-leave-to{ opacity: 0; } .v-leave-active{ transition: opacity 3s; } </style> <div id=‘app‘> <transition> <div v-if=‘show‘>hello world</div> </transition> <button @click=‘handleClick‘>切换</button> </div> <script> var vm = new Vue({ el:‘#app‘, data:{ show:true }, methods:{ handleClick:function(){ this.show = !this.show; } } }) </script>
标签:切换 method function div fun script back rip hand
原文地址:https://www.cnblogs.com/wzndkj/p/9678652.html