]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-core): use currentRenderingInstance directly
authorzhangenming <282126346@qq.com>
Tue, 9 Jan 2024 07:26:07 +0000 (15:26 +0800)
committerGitHub <noreply@github.com>
Tue, 9 Jan 2024 07:26:07 +0000 (15:26 +0800)
packages/runtime-core/src/directives.ts

index a3b44d4c8faf6a659ce7153ed62f93bde531d28b..daaf28b15188e4f369038d0762acda2cc9f429b8 100644 (file)
@@ -88,14 +88,13 @@ export function withDirectives<T extends VNode>(
   vnode: T,
   directives: DirectiveArguments,
 ): T {
-  const internalInstance = currentRenderingInstance
-  if (internalInstance === null) {
+  if (currentRenderingInstance === null) {
     __DEV__ && warn(`withDirectives can only be used inside render functions.`)
     return vnode
   }
   const instance =
-    (getExposeProxy(internalInstance) as ComponentPublicInstance) ||
-    internalInstance.proxy
+    (getExposeProxy(currentRenderingInstance) as ComponentPublicInstance) ||
+    currentRenderingInstance.proxy
   const bindings: DirectiveBinding[] = vnode.dirs || (vnode.dirs = [])
   for (let i = 0; i < directives.length; i++) {
     let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]