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 = {
106
106
var method = mutation . method
107
107
mutationHandlers [ method ] . call ( self , mutation )
108
108
if ( method !== 'push' && method !== 'pop' ) {
109
- self . updateIndex ( )
109
+ var i = arr . length
110
+ while ( i -- ) {
111
+ arr [ i ] . $index = i
112
+ }
110
113
}
111
114
if ( method === 'push' || method === 'unshift' || method === 'splice' ) {
112
115
self . changed ( )
@@ -223,16 +226,6 @@ module.exports = {
223
226
}
224
227
} ,
225
228
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
-
236
229
reset : function ( ) {
237
230
if ( this . childId ) {
238
231
delete this . vm . $ [ this . childId ]
You can’t perform that action at this time.
0 commit comments