Skip to content

Commit

Permalink
fix: avoid TS8013 at slot name in js component
Browse files Browse the repository at this point in the history
close #3121
  • Loading branch information
johnsoncodehk committed May 13, 2023
1 parent 7568f98 commit ea0a658
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-language-core/src/generators/template.ts
Expand Up @@ -732,7 +732,7 @@ export function generate(
}
codes.push(
['', 'template', (slotDir.arg ?? slotDir).loc.start.offset, capabilitiesPresets.diagnosticOnly],
`${componentCtxVar}.slots!`,
`(${componentCtxVar}.slots!)`,
...(
(slotDir?.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && slotDir.arg.content)
? createPropertyAccessCode([
Expand Down
11 changes: 11 additions & 0 deletions packages/vue-test-workspace/vue-tsc/#3121/main.vue
@@ -0,0 +1,11 @@
<template>
<Foo>
<template
v-for="col in slotFilters"
:key="col"
#[`filter-cell-${col}`]="{ column }"
></template>
</Foo>
</template>

<script setup></script>

0 comments on commit ea0a658

Please sign in to comment.