标签:method highlight als min opacity 过渡动画 javascrip city var
<div id="box"> <input type="button" value="按钮" @click="toggle"> <transition name="fade"> <div id="div1" v-show="isShow"></div> </transition> </div> <script src=‘vue.min.js‘></script> <script type="text/javascript"> var vm = new Vue({ el:‘#box‘, data:{ isShow:false }, methods:{ toggle(){ this.isShow = !this.isShow; } } }); </script>
.fade-enter-active, .fade-leave-active { transition: opacity 10.5s } .fade-enter, .fade-leave-active { opacity: 0 } #div1{width: 500px;height: 500px;background: red;}
transition的属性 name就是样式的类名
标签:method highlight als min opacity 过渡动画 javascrip city var
原文地址:http://www.cnblogs.com/fm060/p/7009887.html