Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/guide/typescript/composition-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ While Vue can infer slot types from `<slot>` usage in the template, `defineSlots

A component can forward all of a slot's props to a child component's slot with `<template #default="slotProps"><slot v-bind="slotProps" /></template>`. When that child is the component itself, also known as a [recursive component](/api/sfc-script-setup#recursive-components), TypeScript can't infer the type of `slotProps` and reports `'slotProps' implicitly has type 'any'` unless the slot type is declared explicitly with `defineSlots()`:

```vue
<script setup lang="ts">
const props = defineProps<{ tier: number }>()

Expand All @@ -262,7 +263,6 @@ defineSlots<{
</template>
```


## Typing `ref()` {#typing-ref}

Refs infer the type from the initial value:
Expand Down