Skip to content

Commit 2f9be54

Browse files
gsoufyyx990803
authored andcommitted
improve debug message for invalid dynamic component (vuejs#3524)
1 parent b8f730c commit 2f9be54

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/compiler/compile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,16 @@ export function compileRoot (el, options, contextOptions) {
261261
})
262262
if (names.length) {
263263
var plural = names.length > 1
264+
265+
var componentName = options.el.tagName.toLowerCase()
266+
if (componentName === 'component' && options.name) {
267+
componentName += ':' + options.name
268+
}
269+
264270
warn(
265271
'Attribute' + (plural ? 's ' : ' ') + names.join(', ') +
266272
(plural ? ' are' : ' is') + ' ignored on component ' +
267-
'<' + options.el.tagName.toLowerCase() + '> because ' +
273+
'<' + componentName + '> because ' +
268274
'the component is a fragment instance: ' +
269275
'http://vuejs.org/guide/components.html#Fragment-Instance'
270276
)

0 commit comments

Comments
 (0)