feat: applyDirectives

This commit is contained in:
Evan You 2018-10-09 18:28:23 -04:00
parent ba62deb5d9
commit 4974a47111

View File

@ -71,3 +71,18 @@ export function applyDirective(
} }
return vnode return vnode
} }
type DirectiveArguments = [
Directive,
ComponentInstance,
any,
string | undefined,
DirectiveModifiers | undefined
][]
export function applyDirectives(vnode: VNode, directives: DirectiveArguments) {
for (let i = 0; i < directives.length; i++) {
applyDirective(vnode, ...directives[i])
}
return vnode
}