@@ -64,6 +64,7 @@ import {
64
64
checkCompatEnabled ,
65
65
isCompatEnabled ,
66
66
} from '../compat/compatConfig'
67
+ import { processExpression } from './transformExpression'
67
68
68
69
// some directive transforms (e.g. v-model) may return a symbol for runtime
69
70
// import, which should be used instead of a resolveDirective call.
@@ -253,7 +254,7 @@ export function resolveComponentType(
253
254
254
255
// 1. dynamic component
255
256
const isExplicitDynamic = isComponentTag ( tag )
256
- const isProp = findProp ( node , 'is' )
257
+ const isProp = findProp ( node , 'is' , false , true /* allow empty */ )
257
258
if ( isProp ) {
258
259
if (
259
260
isExplicitDynamic ||
@@ -263,10 +264,19 @@ export function resolveComponentType(
263
264
context ,
264
265
) )
265
266
) {
266
- const exp =
267
- isProp . type === NodeTypes . ATTRIBUTE
268
- ? isProp . value && createSimpleExpression ( isProp . value . content , true )
269
- : isProp . exp
267
+ let exp : ExpressionNode | undefined
268
+ if ( isProp . type === NodeTypes . ATTRIBUTE ) {
269
+ exp = isProp . value && createSimpleExpression ( isProp . value . content , true )
270
+ } else {
271
+ exp = isProp . exp
272
+ if ( ! exp ) {
273
+ // #10469 handle :is shorthand
274
+ exp = createSimpleExpression ( `is` , false , isProp . loc )
275
+ if ( ! __BROWSER__ ) {
276
+ exp = isProp . exp = processExpression ( exp , context )
277
+ }
278
+ }
279
+ }
270
280
if ( exp ) {
271
281
return createCallExpression ( context . helper ( RESOLVE_DYNAMIC_COMPONENT ) , [
272
282
exp ,
0 commit comments