wip: ref v-for compat

This commit is contained in:
Evan You
2021-04-26 17:35:41 -04:00
parent 3e815be24e
commit 86703c23a6
7 changed files with 117 additions and 28 deletions

View File

@@ -590,6 +590,25 @@ export function buildProps(
runtimeDirectives.push(prop)
}
}
if (
__COMPAT__ &&
prop.type === NodeTypes.ATTRIBUTE &&
prop.name === 'ref' &&
context.scopes.vFor > 0 &&
checkCompatEnabled(
CompilerDeprecationTypes.COMPILER_V_FOR_REF,
context,
prop.loc
)
) {
properties.push(
createObjectProperty(
createSimpleExpression('refInFor', true),
createSimpleExpression('true', false)
)
)
}
}
let propsExpression: PropsExpression | undefined = undefined