parent
48e8f2c196
commit
19fb55febf
|
@ -68,8 +68,9 @@ export function withDirectives<T extends Node>(
|
|||
return node
|
||||
}
|
||||
|
||||
if (!currentInstance.dirs.has(node)) currentInstance.dirs.set(node, [])
|
||||
const bindings = currentInstance.dirs.get(node)!
|
||||
const instance = currentInstance
|
||||
if (!instance.dirs.has(node)) instance.dirs.set(node, [])
|
||||
const bindings = instance.dirs.get(node)!
|
||||
|
||||
for (const directive of directives) {
|
||||
let [dir, source, arg, modifiers] = directive
|
||||
|
@ -83,7 +84,7 @@ export function withDirectives<T extends Node>(
|
|||
|
||||
const binding: DirectiveBinding = {
|
||||
dir,
|
||||
instance: currentInstance,
|
||||
instance,
|
||||
source,
|
||||
value: null, // set later
|
||||
oldValue: null,
|
||||
|
@ -93,8 +94,9 @@ export function withDirectives<T extends Node>(
|
|||
bindings.push(binding)
|
||||
|
||||
callDirectiveHook(node, binding, 'created')
|
||||
|
||||
effect(() => {
|
||||
if (!currentInstance!.isMountedRef.value) return
|
||||
if (!instance.isMountedRef.value) return
|
||||
callDirectiveHook(node, binding, 'updated')
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue