-
Notifications
You must be signed in to change notification settings - Fork 151
Closed
Labels
tsTypescript related issueTypescript related issue
Description
Version
- Vue version: 3
- Multiselect: 2.5.6
Description
When trying to use pass slots up, a type error appears.
<template v-for="(_, slot) in $slots" #[slot]="scope">
<slot v-bind="scope" :name="slot" />
</template>
src/App.vue:7:44 - error TS7053: Element implicitly has an 'any' type because expression of type 'string | number' can't be used to index type '{ placeholder: any; afterlist: any; beforelist: any; list: any; multiplelabel: any; singlelabel: any; option: any; groupLabel: any; tag: any; infinite: any; }'.
No index signature with a parameter of type 'string' was found on type '{ placeholder: any; afterlist: any; beforelist: any; list: any; multiplelabel: any; singlelabel: any; option: any; groupLabel: any; tag: any; infinite: any; }'.
#[slot]="scope"
Demo
Run: npm run build
https://codesandbox.io/s/pedantic-sky-hb7dqe?file=/src/App.vue
Metadata
Metadata
Assignees
Labels
tsTypescript related issueTypescript related issue