Browse Source

fixed #3942 (#3947)

* fixed #3942

* fixed #3942
dev
leon lau 8 years ago
committed by Evan You
parent
commit
341d0a0357
  1. 1
      src/core/observer/index.js

1
src/core/observer/index.js

@ -186,6 +186,7 @@ export function defineReactive (
*/ */
export function set (obj: Array<any> | Object, key: any, val: any) { export function set (obj: Array<any> | Object, key: any, val: any) {
if (Array.isArray(obj)) { if (Array.isArray(obj)) {
obj.length = Math.max(obj.length, key)
obj.splice(key, 1, val) obj.splice(key, 1, val)
return val return val
} }

Loading…
Cancel
Save