Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(setData): allow empty objects to be set
fixes #1704 

This is a tentative fix to show one possible solution, I can clean it up if you think it makes sense
  • Loading branch information
Haroenv authored Oct 1, 2020
commit cda6e4b42970c6b468b13f5d62de60bf28c5a553
2 changes: 1 addition & 1 deletion packages/test-utils/src/recursively-set-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function recursivelySetData(vm, target, data) {
const val = data[key]
const targetVal = target[key]

if (isPlainObject(val) && isPlainObject(targetVal)) {
if (isPlainObject(val) && isPlainObject(targetVal) && Object.keys(val).length > 0) {
recursivelySetData(vm, targetVal, val)
} else {
vm.$set(target, key, val)
Expand Down