Ver Fonte

allow empty template (close #3212)

Evan You há 10 anos atrás
pai
commit
163994c6eb
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      src/compiler/transclude.js

+ 3 - 0
src/compiler/transclude.js

@@ -74,6 +74,9 @@ function transcludeTemplate (el, options) {
   var frag = parseTemplate(template, true)
   if (frag) {
     var replacer = frag.firstChild
+    if (!replacer) {
+      return frag
+    }
     var tag = replacer.tagName && replacer.tagName.toLowerCase()
     if (options.replace) {
       /* istanbul ignore if */