|
|
@@ -20,6 +20,7 @@ import { callWithAsyncErrorHandling, ErrorCodes } from './errorHandling'
|
|
|
import { ComponentPublicInstance } from './componentPublicInstance'
|
|
|
import { mapCompatDirectiveHook } from './compat/customDirective'
|
|
|
import { pauseTracking, resetTracking } from '@vue/reactivity'
|
|
|
+import { traverse } from './apiWatch'
|
|
|
|
|
|
export interface DirectiveBinding<V = any> {
|
|
|
instance: ComponentPublicInstance | null
|
|
|
@@ -51,6 +52,7 @@ export interface ObjectDirective<T = any, V = any> {
|
|
|
beforeUnmount?: DirectiveHook<T, null, V>
|
|
|
unmounted?: DirectiveHook<T, null, V>
|
|
|
getSSRProps?: SSRDirectiveHook
|
|
|
+ deep?: boolean
|
|
|
}
|
|
|
|
|
|
export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>
|
|
|
@@ -101,6 +103,9 @@ export function withDirectives<T extends VNode>(
|
|
|
updated: dir
|
|
|
} as ObjectDirective
|
|
|
}
|
|
|
+ if (dir.deep) {
|
|
|
+ traverse(value)
|
|
|
+ }
|
|
|
bindings.push({
|
|
|
dir,
|
|
|
instance,
|