File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,10 @@ module.exports = {
106106 var method = mutation . method
107107 mutationHandlers [ method ] . call ( self , mutation )
108108 if ( method !== 'push' && method !== 'pop' ) {
109- self . updateIndex ( )
109+ var i = arr . length
110+ while ( i -- ) {
111+ arr [ i ] . $index = i
112+ }
110113 }
111114 if ( method === 'push' || method === 'unshift' || method === 'splice' ) {
112115 self . changed ( )
@@ -223,16 +226,6 @@ module.exports = {
223226 }
224227 } ,
225228
226- /**
227- * Update index of each item after a mutation
228- */
229- updateIndex : function ( ) {
230- var i = this . vms . length
231- while ( i -- ) {
232- this . vms [ i ] . $data . $index = i
233- }
234- } ,
235-
236229 reset : function ( ) {
237230 if ( this . childId ) {
238231 delete this . vm . $ [ this . childId ]
You can’t perform that action at this time.
0 commit comments