Skip to content

Commit

Permalink
fix(language-core): map camelized prop name correctly (#5207)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX authored Feb 24, 2025
1 parent af37795 commit 33226fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/language-core/lib/codegen/utils/camelized.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { capitalize } from '@vue/shared';
import type { Code, VueCodeInformation } from '../../types';
import { combineLastMapping } from './index';

export function* generateCamelized(code: string, offset: number, info: VueCodeInformation): Generator<Code> {
const parts = code.split('-');
Expand All @@ -20,7 +19,7 @@ export function* generateCamelized(code: string, offset: number, info: VueCodeIn
capitalize(part),
'template',
offset,
combineLastMapping,
{ __combineOffset: i },
];
}
}
Expand Down
8 changes: 8 additions & 0 deletions test-workspace/tsc/passedFixtures/vue3/#5207/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script lang="ts" setup>
declare function Comp(props: { fooBarBaz: number; }): void;
</script>

<template>
<!-- @vue-expect-error -->
<Comp foo-bar-baz="1"></Comp>
</template>

0 comments on commit 33226fb

Please sign in to comment.