Skip to content

Commit cda6e4b

Browse files
authored
fix(setData): allow empty objects to be set
fixes vuejs#1704 This is a tentative fix to show one possible solution, I can clean it up if you think it makes sense
1 parent a821908 commit cda6e4b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/test-utils/src/recursively-set-data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function recursivelySetData(vm, target, data) {
55
const val = data[key]
66
const targetVal = target[key]
77

8-
if (isPlainObject(val) && isPlainObject(targetVal)) {
8+
if (isPlainObject(val) && isPlainObject(targetVal) && Object.keys(val).length > 0) {
99
recursivelySetData(vm, targetVal, val)
1010
} else {
1111
vm.$set(target, key, val)

0 commit comments

Comments
 (0)