Skip to content

Commit b4f6786

Browse files
fix(reactivity): fix WATCH_ARRAY v2 compat deep watching elements
close #11872
1 parent ed01d92 commit b4f6786

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

packages/runtime-core/src/componentOptions.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -860,22 +860,14 @@ export function createWatcher(
860860
? currentInstance
861861
: null
862862

863-
const newValue = getter()
864-
if (
865-
isArray(newValue) &&
866-
isCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance)
867-
) {
868-
options.deep = true
869-
}
870-
871863
const baseGetter = getter
872864
getter = () => {
873865
const val = baseGetter()
874866
if (
875867
isArray(val) &&
876868
checkCompatEnabled(DeprecationTypes.WATCH_ARRAY, instance)
877869
) {
878-
traverse(val)
870+
traverse(val, 1)
879871
}
880872
return val
881873
}

0 commit comments

Comments
 (0)