@@ -76,12 +76,16 @@ export function* generateElementProps(
76
76
&& ( prop . name === 'model' || prop . arg ?. type === CompilerDOM . NodeTypes . SIMPLE_EXPRESSION )
77
77
&& ( ! prop . exp || prop . exp . type === CompilerDOM . NodeTypes . SIMPLE_EXPRESSION )
78
78
) {
79
- let propName =
80
- prop . arg ?. type === CompilerDOM . NodeTypes . SIMPLE_EXPRESSION
81
- ? prop . arg . constType === CompilerDOM . ConstantTypes . CAN_STRINGIFY
82
- ? prop . arg . content
83
- : prop . arg . loc . source
84
- : getModelValuePropName ( node , options . vueCompilerOptions . target , options . vueCompilerOptions ) ;
79
+ let propName : string | undefined ;
80
+
81
+ if ( prop . arg ?. type === CompilerDOM . NodeTypes . SIMPLE_EXPRESSION ) {
82
+ propName = prop . arg . constType === CompilerDOM . ConstantTypes . CAN_STRINGIFY
83
+ ? prop . arg . content
84
+ : prop . arg . loc . source ;
85
+ }
86
+ else {
87
+ propName = getModelValuePropName ( node , options . vueCompilerOptions . target , options . vueCompilerOptions ) ;
88
+ }
85
89
86
90
if (
87
91
propName === undefined
@@ -110,26 +114,26 @@ export function* generateElementProps(
110
114
prop . loc . start . offset ,
111
115
prop . loc . end . offset ,
112
116
ctx . codeFeatures . verification ,
113
- ...generateObjectProperty (
114
- options ,
115
- ctx ,
116
- propName ,
117
- prop . arg
118
- ? prop . arg . loc . start . offset
119
- : prop . loc . start . offset ,
117
+ ...(
120
118
prop . arg
121
- ? {
122
- ...ctx . codeFeatures . withoutHighlightAndCompletion ,
123
- navigation : ctx . codeFeatures . withoutHighlightAndCompletion . navigation
124
- ? {
125
- resolveRenameNewName : camelize ,
126
- resolveRenameEditText : shouldCamelize ? hyphenateAttr : undefined ,
127
- }
128
- : false ,
129
- }
130
- : ctx . codeFeatures . withoutHighlightAndCompletion ,
131
- ( prop . loc as any ) . name_2 ?? ( ( prop . loc as any ) . name_2 = { } ) ,
132
- shouldCamelize ,
119
+ ? generateObjectProperty (
120
+ options ,
121
+ ctx ,
122
+ propName ,
123
+ prop . arg . loc . start . offset ,
124
+ {
125
+ ...ctx . codeFeatures . withoutHighlightAndCompletion ,
126
+ navigation : ctx . codeFeatures . withoutHighlightAndCompletion . navigation
127
+ ? {
128
+ resolveRenameNewName : camelize ,
129
+ resolveRenameEditText : shouldCamelize ? hyphenateAttr : undefined ,
130
+ }
131
+ : false ,
132
+ } ,
133
+ ( prop . loc as any ) . name_2 ?? ( ( prop . loc as any ) . name_2 = { } ) ,
134
+ shouldCamelize ,
135
+ )
136
+ : [ propName ]
133
137
) ,
134
138
`: (` ,
135
139
...genereatePropExp (
0 commit comments