refactor: simplify resolveDyanmicComponent
This commit is contained in:
@@ -814,8 +814,7 @@ describe('compiler: element transform', () => {
|
||||
{
|
||||
type: NodeTypes.SIMPLE_EXPRESSION,
|
||||
content: 'foo'
|
||||
},
|
||||
'$'
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
@@ -215,11 +215,9 @@ export function resolveComponentType(
|
||||
}
|
||||
// dynamic <component :is="asdf" />
|
||||
else if (isProp.exp) {
|
||||
return createCallExpression(
|
||||
context.helper(RESOLVE_DYNAMIC_COMPONENT),
|
||||
// _ctx.$ exposes the owner instance of current render function
|
||||
[isProp.exp, context.prefixIdentifiers ? `_ctx.$` : `$`]
|
||||
)
|
||||
return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [
|
||||
isProp.exp
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user