diff --git a/packages/runtime-vapor/src/directive.ts b/packages/runtime-vapor/src/directive.ts index 43539f647..9bff0a8eb 100644 --- a/packages/runtime-vapor/src/directive.ts +++ b/packages/runtime-vapor/src/directive.ts @@ -129,11 +129,11 @@ function callDirectiveHook( instance: ComponentInternalInstance | null, name: DirectiveHookName, ) { + if (name === 'beforeUpdate') binding.oldValue = binding.value const { dir } = binding const hook = dir[name] if (!hook) return - if (name === 'beforeUpdate') binding.oldValue = binding.value const newValue = binding.source ? binding.source() : undefined binding.value = newValue // disable tracking inside all lifecycle hooks