vue.js2.0怎么实现多个元素的过渡 财富值34

2016-11-02 18:06发布

    <div id="d2">         <button @click="flag=!flag">切换</button>         <br><br>         <transition>//这里为什么加入name="fade",设置fade-enter类名没效果?             <button v-if="flag">save</button>             <button v-else>edit</button>         </transition>     </div>
var vm2 = new Vue({      el: "#d2",     data:{         flag:true,         }  });    
        .fade-enter-active,.fade-leave{             transition: 3s;             margin-left: 10px;         }         .fade-enter,.fade-leave-active{             margin-left: 100px;         }

这里transition标签怎么设置才能出现过渡效果谢谢