@@ -233,7 +233,7 @@ module.exports = {
233
233
var ctn = this . container ,
234
234
vms = this . vms ,
235
235
col = this . collection ,
236
- el , i , ref , item , primitive , noInsert
236
+ el , i , ref , item , primitive , detached
237
237
238
238
// append node into DOM first
239
239
// so v-if can get access to parentNode
@@ -253,7 +253,7 @@ module.exports = {
253
253
data . $index = index
254
254
// existing VM's el can possibly be detached by v-if.
255
255
// in that case don't insert.
256
- noInsert = ! el . parentNode
256
+ detached = ! el . parentNode
257
257
258
258
} else { // new data, need to create new VM
259
259
@@ -275,11 +275,15 @@ module.exports = {
275
275
: this . ref
276
276
// make sure it works with v-if
277
277
if ( ! ref . parentNode ) ref = ref . vue_ref
278
- // insert node with transition
279
- if ( ! noInsert ) {
278
+ if ( ! detached ) {
279
+ // insert node with transition
280
280
transition ( el , 1 , function ( ) {
281
281
ctn . insertBefore ( el , ref )
282
282
} , this . compiler )
283
+ } else {
284
+ // detached by v-if
285
+ // just move the comment ref node
286
+ ctn . insertBefore ( el . vue_ref , ref )
283
287
}
284
288
}
285
289
0 commit comments