Skip to content

Commit 341d0a0

Browse files
leon lauyyx990803
leon lau
authored andcommitted
fixed #3942 (#3947)
* fixed #3942 * fixed #3942
1 parent 8ba420c commit 341d0a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: src/core/observer/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export function defineReactive (
186186
*/
187187
export function set (obj: Array<any> | Object, key: any, val: any) {
188188
if (Array.isArray(obj)) {
189+
obj.length = Math.max(obj.length, key)
189190
obj.splice(key, 1, val)
190191
return val
191192
}

0 commit comments

Comments
 (0)