@@ -22,6 +22,7 @@ import {
22
22
} from './utils'
23
23
import {
24
24
canSetValueDirectly ,
25
+ capitalize ,
25
26
isSVGTag ,
26
27
shouldSetAsAttr ,
27
28
toHandlerKey ,
@@ -108,15 +109,20 @@ function genLiteralObjectProps(
108
109
}
109
110
110
111
export function genPropKey (
111
- { key : node , modifier, runtimeCamelize, handler } : IRProp ,
112
+ { key : node , modifier, runtimeCamelize, handler, handlerModifiers } : IRProp ,
112
113
context : CodegenContext ,
113
114
) : CodeFragment [ ] {
114
115
const { helper } = context
115
116
117
+ const handlerModifierPostfix = handlerModifiers
118
+ ? handlerModifiers . map ( capitalize ) . join ( '' )
119
+ : ''
116
120
// static arg was transformed by v-bind transformer
117
121
if ( node . isStatic ) {
118
122
// only quote keys if necessary
119
- const keyName = handler ? toHandlerKey ( node . content ) : node . content
123
+ const keyName =
124
+ ( handler ? toHandlerKey ( node . content ) : node . content ) +
125
+ handlerModifierPostfix
120
126
return [
121
127
[
122
128
isSimpleIdentifier ( keyName ) ? keyName : JSON . stringify ( keyName ) ,
@@ -133,7 +139,15 @@ export function genPropKey(
133
139
if ( handler ) {
134
140
key = genCall ( helper ( 'toHandlerKey' ) , key )
135
141
}
136
- return [ '[' , modifier && `${ JSON . stringify ( modifier ) } + ` , ...key , ']' ]
142
+ return [
143
+ '[' ,
144
+ modifier && `${ JSON . stringify ( modifier ) } + ` ,
145
+ ...key ,
146
+ handlerModifierPostfix
147
+ ? ` + ${ JSON . stringify ( handlerModifierPostfix ) } `
148
+ : undefined ,
149
+ ']' ,
150
+ ]
137
151
}
138
152
139
153
export function genPropValue (
0 commit comments