diff --git a/packages/utils/src/accessor.js b/packages/utils/src/accessor.js index 7f7233a2db9..7d88bdeea7a 100644 --- a/packages/utils/src/accessor.js +++ b/packages/utils/src/accessor.js @@ -402,10 +402,10 @@ function _setIn(obj, path, value) { for (let i = 0; i < pathArr.length; i++) { const p = pathArr[i] - + const next = pathArr[i + 1] if (!isObj(obj[p])) { if (obj[p] === undefined && value === undefined) return - obj[p] = {} + obj[p] = /^\d+$/.test(next) ? [] : {} } if (i === pathArr.length - 1) {