8000 also warn built-in element as component for global registration · Mat-Moo/vue@98a288f · GitHub
[go: up one dir, main page]

Skip to content

Commit 98a288f

Browse files
committed
also warn built-in element as component for global registration
1 parent 012bede commit 98a288f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/api/global.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ config._assetTypes.forEach(function (type) {
138138
if (!definition) {
139139
return this.options[type + 's'][id]
140140
} else {
141+
/* istanbul ignore if */
142+
if (process.env.NODE_ENV !== 'production') {
143+
if (type === 'component' && _.commonTagRE.test(id)) {
144+
_.warn(
145+
'Do not use built-in HTML elements as component ' +
146+
'id: ' + id
147+
)
148+
}
149+
}
141150
if (
142151
type === 'component' &&
143152
_.isPlainObject(definition)

0 commit comments

Comments
 (0)
0