mirror of https://github.com/vuejs/core.git
fix(runtime-vapor): update old value even if no beforeUpdate hook
This commit is contained in:
parent
4be349ebc4
commit
75c8ff5cb7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue