html:
<transition name="slide-fade"> <div ref="treeWrap" class="orgBox" v-show="isShow" @mouseout="hideOrg" @mouseover="ShowOrgs"> <elTree :lazy="propLazy" :request="propTreeRequest" :node.sync="syncNode" @hideTree="hideTree"></elTree> </div> </transition>
css:
vue自带的 transition name="slide-fade" 设置动画
.slide-fade-enter-active { transition: all .25s linear; } .slide-fade-leave-active { transition: all .25s linear; } .slide-fade-enter, .slide-fade-leave-to /* .slide-fade-leave-active for below version 2.1.8 */ { transform: translateY(100px); opacity: 0; }