Explorar el Código

fixed #3942 (#3947)

* fixed #3942

* fixed #3942
leon lau hace 9 años
padre
commit
341d0a0357
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      src/core/observer/index.js

+ 1 - 0
src/core/observer/index.js

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