Skip to content

Commit 39000df

Browse files
committed
fix: intersect local $attrs with __VLS_ctx.$attrs
1 parent f68dafb commit 39000df

File tree

2 files changed

+16
-1
lines changed
  • packages/language-core/lib/codegen/template
  • test-workspace/tsc/passedFixtures/vue3/#5111

2 files changed

+16
-1
lines changed

packages/language-core/lib/codegen/template/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function* generateInheritedAttrs(
124124
}
125125
yield `]${endOfLine}`;
126126
}
127-
return `Partial<typeof __VLS_inheritedAttrs> & Record<string, unknown>`;
127+
return `typeof __VLS_ctx.$attrs & Partial<typeof __VLS_inheritedAttrs>`;
128128
}
129129

130130
function* generateRefs(
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script lang="ts" setup>
2+
import { exactType } from '../../shared';
3+
4+
declare module 'vue' {
5+
interface ComponentCustomProperties {
6+
$attrs: {
7+
global: string;
8+
}
9+
}
10+
}
11+
</script>
12+
13+
<template>
14+
{{ exactType($attrs.global, {} as string) }}
15+
</template>

0 commit comments

Comments
 (0)