wip: warn against <template functional>
This commit is contained in:
parent
3ea68691e2
commit
467076361a
@ -155,6 +155,18 @@ export function parse(
|
|||||||
false
|
false
|
||||||
) as SFCTemplateBlock)
|
) as SFCTemplateBlock)
|
||||||
templateBlock.ast = node
|
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 {
|
} else {
|
||||||
errors.push(createDuplicateBlockError(node))
|
errors.push(createDuplicateBlockError(node))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user