Skip to content

Commit

Permalink
fix: should camelize prop name in experimentalModelPropName
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Aug 14, 2024
1 parent 67be01c commit 822a08b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/language-core/lib/utils/ts.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { camelize } from '@vue/shared';
import type * as ts from 'typescript';
import * as path from 'path-browserify';
import type { RawVueCompilerOptions, VueCompilerOptions, VueLanguagePlugin } from '../types';
Expand Down Expand Up @@ -239,15 +240,17 @@ export function resolveVueCompilerOptions(vueOptions: Partial<VueCompilerOptions
experimentalResolveStyleCssClasses: vueOptions.experimentalResolveStyleCssClasses ?? 'scoped',
// https://github.com/vuejs/vue-next/blob/master/packages/compiler-dom/src/transforms/vModel.ts#L49-L51
// https://vuejs.org/guide/essentials/forms.html#form-input-bindings
experimentalModelPropName: vueOptions.experimentalModelPropName ?? {
'': {
input: true
},
value: {
input: { type: 'text' },
textarea: true,
select: true
experimentalModelPropName: Object.fromEntries(Object.entries(
vueOptions.experimentalModelPropName ?? {
'': {
input: true
},
value: {
input: { type: 'text' },
textarea: true,
select: true
}
}
},
).map(([k, v]) => [camelize(k), v])),
};
}
3 changes: 3 additions & 0 deletions test-workspace/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"vue.server.hybridMode": false
}

0 comments on commit 822a08b

Please sign in to comment.