@@ -77,11 +77,11 @@ Fragment.prototype.destroy = function () {
7777 */
7878
7979function singleBefore ( target , withTransition ) {
80+ this . inserted = true
8081 var method = withTransition !== false
8182 ? transition . before
8283 : _ . before
8384 method ( this . node , target , this . vm )
84- this . inserted = true
8585 if ( _ . inDoc ( this . node ) ) {
8686 this . callHook ( attach )
8787 }
@@ -94,10 +94,10 @@ function singleBefore (target, withTransition) {
9494 */
9595
9696function singleRemove ( destroy ) {
97+ this . inserted = false
9798 var shouldCallRemove = _ . inDoc ( this . node )
9899 var self = this
99100 transition . remove ( this . node , this . vm , function ( ) {
100- self . inserted = false
101101 if ( shouldCallRemove ) {
102102 self . callHook ( detach )
103103 }
@@ -111,13 +111,18 @@ function singleRemove (destroy) {
111111 * Insert fragment before target, multi-nodes version
112112 *
113113 * @param {Node } target
114+ * @param {Boolean } withTransition
114115 */
115116
116- function multiBefore ( target ) {
117+ function multiBefore ( target , withTransition ) {
118+ this . inserted = true
119+ var vm = this . vm
120+ var method = withTransition !== false
121+ ? transition . before
122+ : _ . before
117123 _ . mapNodeRange ( this . node , this . end , function ( node ) {
118- _ . before ( node , target )
124+ method ( node , target , vm )
119125 } )
120- this . inserted = true
121126 if ( _ . inDoc ( this . node ) ) {
122127 this . callHook ( attach )
123128 }
@@ -130,18 +135,17 @@ function multiBefore (target) {
130135 */
131136
132137function multiRemove ( destroy ) {
133- var frag = this . frag
138+ this . inserted = false
139+ var self = this
134140 var shouldCallRemove = _ . inDoc ( this . node )
135- _ . mapNodeRange ( this . node , this . end , function ( node ) {
136- frag . appendChild ( node )
141+ _ . removeNodeRange ( this . node , this . end , this . vm , this . frag , function ( ) {
142+ if ( shouldCallRemove ) {
143+ self . callHook ( detach )
144+ }
145+ if ( destroy ) {
146+ self . destroy ( )
147+ }
137148 } )
138- this . inserted = false
139- if ( shouldCallRemove ) {
140- this . callHook ( detach )
141- }
142- if ( destroy ) {
143- this . destroy ( )
144- }
145149}
146150
147151/**
0 commit comments