File tree 1 file changed +16
-7
lines changed 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -108,21 +108,30 @@ module.exports = {
108
108
*/
109
109
110
110
unbuild : function ( remove ) {
111
- if ( ! this . childVM ) {
111
+ var child = this . childVM
112
+ if ( ! child ) {
112
113
return
113
114
}
114
115
if ( this . keepAlive ) {
115
116
if ( remove ) {
116
- this . childVM . $remove ( )
117
+ child . $remove ( )
117
118
}
118
119
} else {
119
- this . childVM . $destroy ( remove )
120
- if ( this . parentDirs ) {
121
- var i = this . parentDirs . length
122
- while ( i -- ) {
123
- this . parentDirs [ i ] . _teardown ( )
120
+ var parentDirs = this . parentDirs
121
+ var destroy = function ( ) {
122
+ child . $destroy ( )
123
+ if ( parentDirs ) {
124
+ var i = parentDirs . length
125
+ while ( i -- ) {
126
+ parentDirs [ i ] . _teardown ( )
127
+ }
124
128
}
125
129
}
130
+ if ( remove ) {
131
+ child . $remove ( destroy )
132
+ } else {
133
+ destroy ( )
134
+ }
126
135
}
127
136
this . childVM = null
128
137
} ,
You can’t perform that action at this time.
0 commit comments