fix(compiler-core): fix svg with directives being incorrectly hoisted (#5919)
fix #5289
This commit is contained in:
@@ -230,6 +230,15 @@ export function getConstantType(
|
||||
// static then they don't need to be blocks since there will be no
|
||||
// nested updates.
|
||||
if (codegenNode.isBlock) {
|
||||
// except set custom directives.
|
||||
for (let i = 0; i < node.props.length; i++) {
|
||||
const p = node.props[i]
|
||||
if (p.type === NodeTypes.DIRECTIVE) {
|
||||
constantCache.set(node, ConstantTypes.NOT_CONSTANT)
|
||||
return ConstantTypes.NOT_CONSTANT
|
||||
}
|
||||
}
|
||||
|
||||
context.removeHelper(OPEN_BLOCK)
|
||||
context.removeHelper(
|
||||
getVNodeBlockHelper(context.inSSR, codegenNode.isComponent)
|
||||
|
||||
Reference in New Issue
Block a user