Property 'item' does not exist on type '{}'
I'm trying out TypeScript with Vue3 and I can't seem to make sense of this warning in VSCode: Property 'item' does not exist on type '{}'. I understand that TypeScript is not able to infer the type of the item property in the slot scope, but I'm not sure how to fix it. The code works, so I'd also be content at this point to suppress the warning, but I don't seem to be able to do that either.
I have the following named slot within a custom table component:
<DataTableVirtual
:items="users"
>
<template v-slot:[`item.is_active`]="{ item }">
<Switch
v-model="item.is_active"
@change="updateUser(item)"
/>
</template>
</DataTableVirtual>
The users data is being passed as a prop from a parent component and is defined as:
defineProps({
users: { type: Array as () => User[] },
});
The User type has been imported. Also, I'm using the setup directive:
<script setup lang="ts">
I appreciate any thoughts on how to either get TypeScript to correctly recognize the item property or to simply suppress the warning.
Please or to participate in this conversation.