8000 improve fragment instance attr warning check (close #1669) · zhangking/vue@7da156e · GitHub
[go: up one dir, main page]

Skip to content

Commit 7da156e

Browse files
committed
improve fragment instance attr warning check (close vuejs#1669)
1 parent abc9a23 commit 7da156e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/compiler/compile.js

Lines changed: 7 additions & 2 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,20 @@ exports.compileRoot = function (el, options, contextOptions) {
213213
// warn container directives for fragment instances
214214
var names = containerAttrs
215215
.filter(function (attr) {
216-
return attr.name.indexOf('_v-') < 0
216+
// allow vue-loader/vueify scoped css attributes
217+
return attr.name.indexOf('_v-') < 0 &&
218+
// allow event listeners
219+
!onRE.test(attr.name) &&
220+
// allow slots
221+
attr.name !== 'slot'
217222
})
218223
.map(function (attr) {
219224
return '"' + attr.name + '"'
220225
})
221226
if (names.length) {
222227
var plural = names.length > 1
223228
_.warn(
224-
'Attribute' + (plural ? 's ' : ' ') + names.join(',') +
229+
'Attribute' + (plural ? 's ' : ' ') + names.join(', ') +
225230
(plural ? ' are' : ' is') + ' ignored on component ' +
226231
'<' + options.el.tagName.toLowerCase() + '> because ' +
227232
'the component is a fragment instance: ' +

0 commit comments

Comments
 (0)
0