mirror of https://github.com/vuejs/core.git
refactor(runtime-core): use currentRenderingInstance directly
This commit is contained in:
parent
9c54dacd0d
commit
64e9c9616d
|
|
@ -88,14 +88,13 @@ export function withDirectives<T extends VNode>(
|
||||||
vnode: T,
|
vnode: T,
|
||||||
directives: DirectiveArguments,
|
directives: DirectiveArguments,
|
||||||
): T {
|
): T {
|
||||||
const internalInstance = currentRenderingInstance
|
if (currentRenderingInstance === null) {
|
||||||
if (internalInstance === null) {
|
|
||||||
__DEV__ && warn(`withDirectives can only be used inside render functions.`)
|
__DEV__ && warn(`withDirectives can only be used inside render functions.`)
|
||||||
return vnode
|
return vnode
|
||||||
}
|
}
|
||||||
const instance =
|
const instance =
|
||||||
(getExposeProxy(internalInstance) as ComponentPublicInstance) ||
|
(getExposeProxy(currentRenderingInstance) as ComponentPublicInstance) ||
|
||||||
internalInstance.proxy
|
currentRenderingInstance.proxy
|
||||||
const bindings: DirectiveBinding[] = vnode.dirs || (vnode.dirs = [])
|
const bindings: DirectiveBinding[] = vnode.dirs || (vnode.dirs = [])
|
||||||
for (let i = 0; i < directives.length; i++) {
|
for (let i = 0; i < directives.length; i++) {
|
||||||
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]
|
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue