8000 compile: warn directives on fragment instance placeholders · justnull/vue@f7dab27 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7dab27

Browse files
committed
compile: warn directives on fragment instance placeholders
1 parent b6cceaa commit f7dab27

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
@@ -205,6 +205,18 @@ exports.compileRoot = function (el, options) {
205205
// non-component, just compile as a normal element.
206206
replacerLinkFn = compileDirectives(el.attributes, options)
207207
}
208+
} else if (process.env.NODE_ENV !== 'production' && containerAttrs) {
209+
// warn container directives for fragment instances
210+
containerAttrs.forEach(function (attr) {
211+
if (attr.name.indexOf('v-') === 0 || attr.name === 'transition') {
212+
_.warn(
213+
attr.name + ' is ignored on component ' +
214+
'<' + options.el.tagName.toLowerCase() + '> because ' +
215+
'the component is a fragment instance: ' +
216+
'http://vuejs.org/guide/components.html#Fragment_Instance'
217+
)
218+
}
219+
})
208220
}
209221

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

0 commit comments

Comments
 (0)
0