fix(runtime-vapor): update old value even if no beforeUpdate hook

This commit is contained in:
三咲智子 Kevin Deng 2024-02-07 20:38:12 +08:00
parent 4be349ebc4
commit 75c8ff5cb7
No known key found for this signature in database
GPG Key ID: 69992F2250DFD93E
1 changed files with 1 additions and 1 deletions

View File

@ -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