Skip to content

Commit 8eda337

Browse files
authored
fix(language-core): should camelize prop name in experimentalModelPropName (#4691)
1 parent fc22bf7 commit 8eda337

File tree

1 file changed

+12
-9
lines changed
  • packages/language-core/lib/utils

1 file changed

+12
-9
lines changed

packages/language-core/lib/utils/ts.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { camelize } from '@vue/shared';
12
import type * as ts from 'typescript';
23
import * as path from 'path-browserify';
34
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePlugin } from '../types';
@@ -243,15 +244,17 @@ export function resolveVueCompilerOptions(vueOptions: Partial<VueCompilerOptions
243244
experimentalResolveStyleCssClasses: vueOptions.experimentalResolveStyleCssClasses ?? 'scoped',
244245
// https://github.com/vuejs/vue-next/blob/master/packages/compiler-dom/src/transforms/vModel.ts#L49-L51
245246
// https://vuejs.org/guide/essentials/forms.html#form-input-bindings
246-
experimentalModelPropName: vueOptions.experimentalModelPropName ?? {
247-
'': {
248-
input: true
249-
},
250-
value: {
251-
input: { type: 'text' },
252-
textarea: true,
253-
select: true
247+
experimentalModelPropName: Object.fromEntries(Object.entries(
248+
vueOptions.experimentalModelPropName ?? {
249+
'': {
250+
input: true
251+
},
252+
value: {
253+
input: { type: 'text' },
254+
textarea: true,
255+
select: true
256+
}
254257
}
255-
},
258+
).map(([k, v]) => [camelize(k), v])),
256259
};
257260
}

0 commit comments

Comments
 (0)