@@ -107,21 +107,14 @@ module.exports = {
107
107
if ( ! tokens ) { // static component
108
108
var Ctor = this . Ctor = options . components [ id ]
109
109
_ . assertAsset ( Ctor , 'component' , id )
110
- // If there's no parent scope directives and no
111
- // content to be transcluded, we can optimize the
112
- // rendering by pre-transcluding + compiling here
113
- // and provide a link function to every instance.
114
- if ( ! this . el . hasChildNodes ( ) &&
115
- ! this . el . hasAttributes ( ) ) {
116
- // merge an empty object with owner vm as parent
117
- // so child vms can access parent assets.
118
- var merged = mergeOptions ( Ctor . options , { } , {
119
- $parent : this . vm
120
- } )
121
- merged . template = this . inlineTempalte || merged . template
122
- this . template = transclude ( this . template , merged )
123
- this . _linkFn = compile ( this . template , merged )
124
- }
110
+ var merged = mergeOptions ( Ctor . options , { } , {
111
+ $parent : this . vm
112
+ } )
113
+ merged . template = this . inlineTempalte || merged . template
114
+ merged . _asComponent = true
115
+ merged . _parent = this . vm
116
+ this . template = transclude ( this . template , merged )
117
+ this . _linkFn = compile ( this . template , merged )
125
118
} else {
126
119
// to be resolved later
127
120
var ctorExp = textParser . tokensToExp ( tokens )
0 commit comments