Skip to content

Commit

Permalink
test: multiple generic params
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Nov 1, 2024
1 parent 3b20821 commit 8d8a220
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test-workspace/tsc/passedFixtures/vue3/v-generic/comp.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts" generic="T extends string | number">
<script setup lang="ts" generic="T extends string | number, K = any">
defineEmits<{
foo: [val: T]
foo: [bar: T, baz: K]
}>();
</script>
7 changes: 5 additions & 2 deletions test-workspace/tsc/passedFixtures/vue3/v-generic/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import Comp from './comp.vue';
</script>

<template>
<Comp v-generic="number" @foo="(val) => exactType(val, {} as number)"/>
<Comp v-generic="string" @foo="(val) => exactType(val, {} as string)"/>
<Comp v-generic="string" @foo="(bar) => exactType(bar, {} as string)"/>
<Comp v-generic="number, boolean" @foo="(bar, baz) => (
exactType(bar, {} as number),
exactType(baz, {} as boolean)
)"/>
<!-- @vue-expect-error -->
<Comp v-generic="boolean" />
</template>

0 comments on commit 8d8a220

Please sign in to comment.