From f764db4b01861f79a347b14ecf6313cc174cc12c Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 15 Aug 2016 12:49:21 -0400 Subject: [PATCH] more robust parent transition skip check --- src/platforms/web/runtime/components/transition.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/platforms/web/runtime/components/transition.js b/src/platforms/web/runtime/components/transition.js index 05d9fc62e..4430e17f0 100644 --- a/src/platforms/web/runtime/components/transition.js +++ b/src/platforms/web/runtime/components/transition.js @@ -54,6 +54,14 @@ function placeholder (h, rawChild) { : null } +function hasParentTransition (vnode) { + while ((vnode = vnode.parent)) { + if (vnode.data.transition) { + return true + } + } +} + export default { name: 'transition', props: transitionProps, @@ -95,7 +103,7 @@ export default { // if this is a component root node and the component's // parent container node also has transition, skip. - if (this.$vnode.parent && this.$vnode.parent.data.transition) { + if (hasParentTransition(this.$vnode)) { return rawChild }