@@ -398,15 +398,15 @@ const transformJSXElement = (
398398 . map ( ( n ) => PatchFlagNames [ n ] )
399399 . join ( ', ' ) ;
400400
401- const { compatibleProps } = state . opts ;
401+ const { compatibleProps = false , usePatchFlag = true } = state . opts ;
402402 if ( compatibleProps && ! state . get ( 'compatibleProps' ) ) {
403403 state . set ( 'compatibleProps' , addDefault (
404404 path , '@ant-design-vue/babel-helper-vue-compatible-props' , { nameHint : '_compatibleProps' } ,
405405 ) ) ;
406406 }
407407
408408 // @ts -ignore
409- const createVNode = t . callExpression ( createIdentifier ( state , 'createVNode' ) , [
409+ const createVNode = t . callExpression ( createIdentifier ( state , usePatchFlag ? 'createVNode' : 'h ') , [
410410 tag ,
411411 // @ts -ignore
412412 compatibleProps ? t . callExpression ( state . get ( 'compatibleProps' ) , [ props ] ) : props ,
@@ -425,12 +425,12 @@ const transformJSXElement = (
425425 ] . filter ( Boolean as any as ExcludesBoolean ) )
426426 : t . arrayExpression ( children )
427427 ) : t . nullLiteral ( ) ,
428- ! ! patchFlag && (
428+ ! ! patchFlag && usePatchFlag && (
429429 useOptimate
430430 ? t . addComment ( t . numericLiteral ( patchFlag ) , 'trailing' , ` ${ flagNames } ` , false )
431431 : t . numericLiteral ( PatchFlags . BAIL )
432432 ) ,
433- ! ! dynamicPropNames . size
433+ ! ! dynamicPropNames . size && usePatchFlag
434434 && t . arrayExpression ( [ ...dynamicPropNames . keys ( ) ] . map ( ( name ) => t . stringLiteral ( name as string ) ) ) ,
435435 ] . filter ( Boolean as any as ExcludesBoolean ) ) ;
436436
0 commit comments