Skip to content

Commit ec4ac09

Browse files
committed
compile: warn directives on fragment instance placeholders
1 parent 9b50ee3 commit ec4ac09

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/compiler/compile.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ exports.compileRoot = function (el, options) {
206206
// non-component, just compile as a normal element.
207207
replacerLinkFn = compileDirectives(el.attributes, options)
208208
}
209+
} else if (process.env.NODE_ENV !== 'production' && containerAttrs) {
210+
// warn container directives for fragment instances
211+
containerAttrs.forEach(function (attr) {
212+
if (attr.name.indexOf('v-') === 0 || attr.name === 'transition') {
213+
_.warn(
214+
attr.name + ' is ignored on component ' +
215+
'<' + options.el.tagName.toLowerCase() + '> because ' +
216+
'the component is a fragment instance: ' +
217+
'http://vuejs.org/guide/components.html#Fragment_Instance'
218+
)
219+
}
220+
})
209221
}
210222

211223
return function rootLinkFn (vm, el, scope) {

0 commit comments

Comments
 (0)