Browse Source

handle <component> as fragment instance

Evan You 11 years ago
parent
commit
1c9926f5c8
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/compiler/transclude.js

+ 5 - 3
src/compiler/transclude.js

@@ -70,11 +70,13 @@ function transcludeTemplate (el, options) {
         frag.childNodes.length > 1 ||
         // non-element template
         replacer.nodeType !== 1 ||
-        // when root node is <content>, <partial> or has
-        // v-repeat, the instance could end up having
+        // when root node is <content>, <partial>, <component>
+        // or has v-repeat, the instance could end up having
         // multiple top-level nodes, thus becoming a block
         // instance.
-        tag === 'content' || tag === 'partial' ||
+        tag === 'content' ||
+        tag === 'partial' ||
+        tag === 'component' ||
         replacer.hasAttribute(config.prefix + 'repeat')
       ) {
         return frag