@@ -41,24 +41,24 @@ export function* generateElementEvents(
41
41
if ( ! options . vueCompilerOptions . strictTemplates ) {
42
42
yield `Record<string, unknown> & ` ;
43
43
}
44
- yield `Partial< ` ;
44
+ yield `( ` ;
45
45
yield `__VLS_IsAny<__VLS_AsFunctionOrAny<typeof ${ propsVar } ['${ originalPropName } ']>> extends false${ newLine } ` ;
46
46
yield `? typeof ${ propsVar } ${ newLine } ` ;
47
47
yield `: __VLS_IsAny<typeof ${ eventsVar } ['${ prop . arg . loc . source } ']> extends false${ newLine } ` ;
48
48
yield `? {${ newLine } ` ;
49
49
yield `/**__VLS_emit,${ emitVar } ,${ prop . arg . loc . source } */${ newLine } ` ;
50
- yield `${ originalPropNameObjectKey } : typeof ${ eventsVar } ['${ prop . arg . loc . source } ']${ newLine } ` ;
50
+ yield `${ originalPropNameObjectKey } ? : typeof ${ eventsVar } ['${ prop . arg . loc . source } ']${ newLine } ` ;
51
51
yield `}${ newLine } ` ;
52
52
if ( prop . arg . loc . source !== camelize ( prop . arg . loc . source ) ) {
53
53
yield `: __VLS_IsAny<typeof ${ eventsVar } ['${ camelize ( prop . arg . loc . source ) } ']> extends false${ newLine } ` ;
54
54
yield `? {${ newLine } ` ;
55
55
yield `/**__VLS_emit,${ emitVar } ,${ camelize ( prop . arg . loc . source ) } */${ newLine } ` ;
56
- yield `${ originalPropNameObjectKey } : typeof ${ eventsVar } ['${ camelize ( prop . arg . loc . source ) } ']${ newLine } ` ;
56
+ yield `${ originalPropNameObjectKey } ? : typeof ${ eventsVar } ['${ camelize ( prop . arg . loc . source ) } ']${ newLine } ` ;
57
57
yield `}${ newLine } ` ;
58
58
}
59
59
yield `: typeof ${ propsVar } ${ newLine } ` ;
60
- yield `> = {${ newLine } ` ;
61
- yield * generateEventArg ( options , ctx , prop . arg , true ) ;
60
+ yield `) = {${ newLine } ` ;
61
+ yield * generateEventArg ( ctx , prop . arg , true ) ;
62
62
yield `: ` ;
63
63
yield * generateEventExpression ( options , ctx , prop ) ;
64
64
yield `}${ endOfLine } ` ;
@@ -104,7 +104,6 @@ const eventArgFeatures: VueCodeInformation = {
104
104
} ;
105
105
106
106
export function * generateEventArg (
107
- options : TemplateCodegenOptions ,
108
107
ctx : TemplateCodegenContext ,
109
108
arg : CompilerDOM . SimpleExpressionNode ,
110
109
enableHover : boolean ,
@@ -115,21 +114,7 @@ export function* generateEventArg(
115
114
...eventArgFeatures ,
116
115
}
117
116
: eventArgFeatures ;
118
- if ( arg . loc . source . startsWith ( '[' ) && arg . loc . source . endsWith ( ']' ) ) {
119
- yield `[` ;
120
- yield * generateInterpolation (
121
- options ,
122
- ctx ,
123
- arg . loc . source . slice ( 1 , - 1 ) ,
124
- arg . loc ,
125
- arg . loc . start . offset + 1 ,
126
- ctx . codeFeatures . all ,
127
- '' ,
128
- '' ,
129
- ) ;
130
- yield `]` ;
131
- }
132
- else if ( variableNameRegex . test ( camelize ( arg . loc . source ) ) ) {
117
+ if ( variableNameRegex . test ( camelize ( arg . loc . source ) ) ) {
133
118
yield [ '' , 'template' , arg . loc . start . offset , features ] ;
134
119
yield `on` ;
135
120
yield * generateCamelized (
0 commit comments