|
|
@@ -344,6 +344,28 @@ export function createHydrationFunctions(
|
|
|
if (dirs) {
|
|
|
invokeDirectiveHook(vnode, null, parentComponent, 'created')
|
|
|
}
|
|
|
+
|
|
|
+ // handle appear transition
|
|
|
+ let needCallTransitionHooks = false
|
|
|
+ if (isTemplateNode(el)) {
|
|
|
+ needCallTransitionHooks =
|
|
|
+ needTransition(parentSuspense, transition) &&
|
|
|
+ parentComponent &&
|
|
|
+ parentComponent.vnode.props &&
|
|
|
+ parentComponent.vnode.props.appear
|
|
|
+
|
|
|
+ const content = (el as HTMLTemplateElement).content
|
|
|
+ .firstChild as Element
|
|
|
+
|
|
|
+ if (needCallTransitionHooks) {
|
|
|
+ transition!.beforeEnter(content)
|
|
|
+ }
|
|
|
+
|
|
|
+ // replace <template> node with inner children
|
|
|
+ replaceNode(content, el, parentComponent)
|
|
|
+ vnode.el = el = content
|
|
|
+ }
|
|
|
+
|
|
|
// props
|
|
|
if (props) {
|
|
|
if (
|
|
|
@@ -390,27 +412,6 @@ export function createHydrationFunctions(
|
|
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode)
|
|
|
}
|
|
|
|
|
|
- // handle appear transition
|
|
|
- let needCallTransitionHooks = false
|
|
|
- if (isTemplateNode(el)) {
|
|
|
- needCallTransitionHooks =
|
|
|
- needTransition(parentSuspense, transition) &&
|
|
|
- parentComponent &&
|
|
|
- parentComponent.vnode.props &&
|
|
|
- parentComponent.vnode.props.appear
|
|
|
-
|
|
|
- const content = (el as HTMLTemplateElement).content
|
|
|
- .firstChild as Element
|
|
|
-
|
|
|
- if (needCallTransitionHooks) {
|
|
|
- transition!.beforeEnter(content)
|
|
|
- }
|
|
|
-
|
|
|
- // replace <template> node with inner children
|
|
|
- replaceNode(content, el, parentComponent)
|
|
|
- vnode.el = el = content
|
|
|
- }
|
|
|
-
|
|
|
if (dirs) {
|
|
|
invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount')
|
|
|
}
|