@@ -6,12 +6,14 @@ import {
6
6
type SlotOutletNode ,
7
7
createCallExpression ,
8
8
createFunctionExpression ,
9
+ createSimpleExpression ,
9
10
} from '../ast'
10
11
import { isSlotOutlet , isStaticArgOf , isStaticExp } from '../utils'
11
12
import { type PropsExpression , buildProps } from './transformElement'
12
13
import { ErrorCodes , createCompilerError } from '../errors'
13
14
import { RENDER_SLOT } from '../runtimeHelpers'
14
15
import { camelize } from '@vue/shared'
16
+ import { processExpression } from './transformExpression'
15
17
16
18
export const transformSlotOutlet : NodeTransform = ( node , context ) => {
17
19
if ( isSlotOutlet ( node ) ) {
@@ -76,7 +78,15 @@ export function processSlotOutlet(
76
78
}
77
79
} else {
78
80
if ( p . name === 'bind' && isStaticArgOf ( p . arg , 'name' ) ) {
79
- if ( p . exp ) slotName = p . exp
81
+ if ( p . exp ) {
82
+ slotName = p . exp
83
+ } else if ( p . arg && p . arg . type === NodeTypes . SIMPLE_EXPRESSION ) {
84
+ const name = camelize ( p . arg . content )
85
+ slotName = p . exp = createSimpleExpression ( name , false , p . arg . loc )
86
+ if ( ! __BROWSER__ ) {
87
+ slotName = p . exp = processExpression ( p . exp , context )
88
+ }
89
+ }
80
90
} else {
81
91
if ( p . name === 'bind' && p . arg && isStaticExp ( p . arg ) ) {
82
92
p . arg . content = camelize ( p . arg . content )
0 commit comments