Explorar o código

improve debug message for invalid dynamic component (#3524)

Soufiane Ghzal %!s(int64=9) %!d(string=hai) anos
pai
achega
2f9be54ef1
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/compiler/compile.js

+ 7 - 1
src/compiler/compile.js

@@ -261,10 +261,16 @@ export function compileRoot (el, options, contextOptions) {
       })
       })
     if (names.length) {
     if (names.length) {
       var plural = names.length > 1
       var plural = names.length > 1
+
+      var componentName = options.el.tagName.toLowerCase()
+      if (componentName === 'component' && options.name) {
+        componentName += ':' + options.name
+      }
+
       warn(
       warn(
         'Attribute' + (plural ? 's ' : ' ') + names.join(', ') +
         'Attribute' + (plural ? 's ' : ' ') + names.join(', ') +
         (plural ? ' are' : ' is') + ' ignored on component ' +
         (plural ? ' are' : ' is') + ' ignored on component ' +
-        '<' + options.el.tagName.toLowerCase() + '> because ' +
+        '<' + componentName + '> because ' +
         'the component is a fragment instance: ' +
         'the component is a fragment instance: ' +
         'http://vuejs.org/guide/components.html#Fragment-Instance'
         'http://vuejs.org/guide/components.html#Fragment-Instance'
       )
       )