File tree 6 files changed +5
-37
lines changed
6 files changed +5
-37
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ module.exports = {
166
166
return cached
167
167
}
168
168
}
169
- var vm = this . vm
169
+ var vm = this . _host || this . vm
170
170
var el = templateParser . clone ( this . el )
171
171
if ( this . Ctor ) {
172
172
var child = vm . $addChild ( {
@@ -177,7 +177,6 @@ module.exports = {
177
177
// linker can be cached for better performance.
178
178
_linkerCachable : ! this . template ,
179
179
_asComponent : true ,
180
- _host : this . _host ,
181
180
_isRouterView : this . _isRouterView
182
181
} , this . Ctor )
183
182
if ( this . keepAlive ) {
Original file line number Diff line number Diff line change @@ -78,12 +78,6 @@ module.exports = {
78
78
var vm = this . vm
79
79
var start = this . start . nextSibling
80
80
var end = this . end
81
- var selfCompoents =
82
- vm . $children . length &&
83
- vm . $children . filter ( contains )
84
- var transComponents =
85
- vm . _transCpnts &&
86
- vm . _transCpnts . filter ( contains )
87
81
88
82
function contains ( c ) {
89
83
var cur = start
@@ -101,11 +95,8 @@ module.exports = {
101
95
return false
102
96
}
103
97
104
- return selfCompoents
105
- ? transComponents
106
- ? selfCompoents . concat ( transComponents )
107
- : selfCompoents
108
- : transComponents
98
+ return vm . $children . length &&
99
+ vm . $children . filter ( contains )
109
100
} ,
110
101
111
102
unbind : function ( ) {
Original file line number Diff line number Diff line change @@ -346,7 +346,8 @@ module.exports = {
346
346
}
347
347
// resolve constructor
348
348
var Ctor = this . Ctor || this . resolveDynamicComponent ( data , meta )
349
- var vm = this . vm . $addChild ( {
349
+ var owner = this . _host || this . vm
350
+ var vm = owner . $addChild ( {
350
351
el : templateParser . clone ( this . template ) ,
351
352
data : data ,
352
353
inherit : this . inherit ,
@@ -359,8 +360,6 @@ module.exports = {
359
360
_asComponent : this . asComponent ,
360
361
// linker cachable if no inline-template
361
362
_linkerCachable : ! this . inlineTemplate && Ctor !== _ . Vue ,
362
- // transclusion host
363
- _host : this . _host ,
364
363
// pre-compiled linker for simple repeats
365
364
_linkFn : this . _linkFn ,
366
365
// identifier, shows that this vm belongs to this collection
Original file line number Diff line number Diff line change @@ -129,11 +129,6 @@ exports._destroy = function (remove, deferCleanup) {
129
129
if ( parent && ! parent . _isBeingDestroyed ) {
130
130
parent . $children . $remove ( this )
131
131
}
132
- // same for transclusion host.
133
- var host = this . _host
134
- if ( host && ! host . _isBeingDestroyed ) {
135
- host . _transCpnts . $remove ( this )
136
- }
137
132
// destroy all children.
138
133
i = this . $children . length
139
134
while ( i -- ) {
@@ -182,7 +177,6 @@ exports._cleanup = function () {
182
177
this . $parent =
183
178
this . $root =
184
179
this . $children =
185
- this . _transCpnts =
186
180
this . _directives = null
187
181
// call the last hook...
188
182
this . _isDestroyed = true
Original file line number Diff line number Diff line change @@ -80,9 +80,6 @@ exports._initDOMHooks = function () {
80
80
function onAttached ( ) {
81
81
this . _isAttached = true
82
82
this . $children . forEach ( callAttach )
83
- if ( this . _transCpnts . length ) {
84
- this . _transCpnts . forEach ( callAttach )
85
- }
86
83
}
87
84
88
85
/**
@@ -104,9 +101,6 @@ function callAttach (child) {
104
101
function onDetached ( ) {
105
102
this . _isAttached = false
106
103
this . $children . forEach ( callDetach )
107
- if ( this . _transCpnts . length ) {
108
- this . _transCpnts . forEach ( callDetach )
109
- }
110
104
}
111
105
112
106
/**
Original file line number Diff line number Diff line change @@ -48,19 +48,10 @@ exports._init = function (options) {
48
48
this . $children = [ ]
49
49
this . _childCtors = { }
50
50
51
- // transcluded components that belong to the parent.
52
- // need to keep track of them so that we can call
53
- // attached/detached hooks on them.
54
- this . _transCpnts = [ ]
55
- this . _host = options . _host
56
-
57
51
// push self into parent / transclusion host
58
52
if ( this . $parent ) {
59
53
this . $parent . $children . push ( this )
60
54
}
61
- if ( this . _host ) {
62
- this . _host . _transCpnts . push ( this )
63
- }
64
55
65
56
// props used in v-repeat diffing
66
57
this . _reused = false
You can’t perform that action at this time.
0 commit comments