wip: vnodeXXX directive hooks

This commit is contained in:
Evan You
2019-08-31 17:06:39 -04:00
parent 1c6ecf4144
commit 0f0ca4ae7c
4 changed files with 34 additions and 4 deletions

View File

@@ -35,6 +35,7 @@ import { resolveSlots } from './componentSlots'
import { PatchFlags } from './patchFlags'
import { ShapeFlags } from './shapeFlags'
import { pushWarningContext, popWarningContext, warn } from './warning'
import { invokeDirectiveHook } from './directives'
const prodEffectOptions = {
scheduler: queueJob
@@ -248,6 +249,7 @@ export function createRenderer(options: RendererOptions) {
if (isReservedProp(key)) continue
hostPatchProp(el, key, props[key], null, isSVG)
}
invokeDirectiveHook(props.vnodeBeforeMount, parentComponent, vnode)
}
if (shapeFlag & ShapeFlags.TEXT_CHILDREN) {
hostSetElementText(el, vnode.children as string)
@@ -261,6 +263,9 @@ export function createRenderer(options: RendererOptions) {
)
}
hostInsert(el, container, anchor)
if (props != null) {
invokeDirectiveHook(props.vnodeMounted, parentComponent, vnode)
}
}
function mountChildren(