diff --git a/packages/language-core/lib/codegen/template/elementProps.ts b/packages/language-core/lib/codegen/template/elementProps.ts index dcbd5a9102..7bbb49dbcc 100644 --- a/packages/language-core/lib/codegen/template/elementProps.ts +++ b/packages/language-core/lib/codegen/template/elementProps.ts @@ -132,7 +132,12 @@ export function* generateElementProps( (prop.loc as any).name_2 ?? ((prop.loc as any).name_2 = {}), shouldCamelize ) - : [propName] + : wrapWith( + prop.loc.start.offset, + prop.loc.start.offset + 'v-model'.length, + ctx.codeFeatures.verification, + propName + ) ), `: (`, ...genereatePropExp( diff --git a/test-workspace/tsc/vue2/tsconfig.json b/test-workspace/tsc/vue2/tsconfig.json index 3363c6cf0b..9aaa7ba292 100644 --- a/test-workspace/tsc/vue2/tsconfig.json +++ b/test-workspace/tsc/vue2/tsconfig.json @@ -20,6 +20,7 @@ "../vue3/#3782", "../vue3/#4327", "../vue3/#4512", + "../vue3/#4540", "../vue3/components", "../vue3/defineEmits", "../vue3/defineModel", diff --git a/test-workspace/tsc/vue3/#4540/component.vue b/test-workspace/tsc/vue3/#4540/component.vue new file mode 100644 index 0000000000..ecb17553ea --- /dev/null +++ b/test-workspace/tsc/vue3/#4540/component.vue @@ -0,0 +1,5 @@ + diff --git a/test-workspace/tsc/vue3/#4540/main.vue b/test-workspace/tsc/vue3/#4540/main.vue new file mode 100644 index 0000000000..eb2fbb9d39 --- /dev/null +++ b/test-workspace/tsc/vue3/#4540/main.vue @@ -0,0 +1,13 @@ + + +