We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
昨天做程序的时候遇到一个需要做半场动画的需求,查了下官方文档可以用钩子函数实现,但实际用的时候还是有几个要注意的地方,稍微记一下
<transition v-on:before-enter="beforeEnter" v-on:enter="enter" v-on:after-enter="afterEnter" v-on:enter-cancelled="enterCancelled" v-on:before-leave="beforeLeave" v-on:leave="leave" v-on:after-leave="afterLeave" v-on:leave-cancelled="leaveCancelled" > <!-- ... --> </transition>
methods: { // -------- // 进入中 // -------- beforeEnter: function (el) { // ... }, // 当与 CSS 结合使用时 // 回调函数 done 是可选的 enter: function (el, done) { // ... el.offWidth; //使用这个使 DOM 进行重绘,不然没有的动画效果 done() //使用这个才能防止动画被同步调用,否则动画将立即完成 }, afterEnter: function (el) { // ... }, enterCancelled: function (el) { // ... }, // -------- // 离开时 // -------- beforeLeave: function (el) { // ... }, // 当与 CSS 结合使用时 // 回调函数 done 是可选的 leave: function (el, done) { // ... done() }, afterLeave: function (el) { // ... }, // leaveCancelled 只用于 v-show 中 leaveCancelled: function (el) { // ... } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
昨天做程序的时候遇到一个需要做半场动画的需求,查了下官方文档可以用钩子函数实现,但实际用的时候还是有几个要注意的地方,稍微记一下
The text was updated successfully, but these errors were encountered: