wip: warn against <template functional>

This commit is contained in:
Evan You 2021-04-17 23:51:40 -04:00
parent 3ea68691e2
commit 467076361a

View File

@ -155,6 +155,18 @@ export function parse(
false
) as SFCTemplateBlock)
templateBlock.ast = node
// warn against 2.x <template functional>
if (templateBlock.attrs.functional) {
const err = new SyntaxError(
`<template functional> is no longer supported in Vue 3, since ` +
`functional components no longer have significant performance ` +
`difference from stateful ones. Just use a normal <template> ` +
`instead.`
) as CompilerError
err.loc = node.props.find(p => p.name === 'functional')!.loc
errors.push(err)
}
} else {
errors.push(createDuplicateBlockError(node))
}