fix: resolveDynamicComponent should use context instance

This commit is contained in:
Evan You
2019-11-25 10:04:40 -05:00
parent 01eb3c12e9
commit 08a3d95e52
4 changed files with 35 additions and 9 deletions

View File

@@ -86,7 +86,8 @@ export const transformElement: NodeTransform = (node, context) => {
else if (isProp.exp) {
dynamicComponent = createCallExpression(
context.helper(RESOLVE_DYNAMIC_COMPONENT),
[isProp.exp]
// _ctx.$ exposes the owner instance of current render function
[isProp.exp, context.prefixIdentifiers ? `_ctx.$` : `$`]
)
}
}