소스 검색

improve debug message for invalid dynamic component (#3524)

Soufiane Ghzal 9 년 전
부모
커밋
2f9be54ef1
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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) {
       var plural = names.length > 1
+
+      var componentName = options.el.tagName.toLowerCase()
+      if (componentName === 'component' && options.name) {
+        componentName += ':' + options.name
+      }
+
       warn(
         'Attribute' + (plural ? 's ' : ' ') + names.join(', ') +
         (plural ? ' are' : ' is') + ' ignored on component ' +
-        '<' + options.el.tagName.toLowerCase() + '> because ' +
+        '<' + componentName + '> because ' +
         'the component is a fragment instance: ' +
         'http://vuejs.org/guide/components.html#Fragment-Instance'
       )