multiselect
multiselect copied to clipboard
Typescript Build Error
Version
- Vue version: 3.2.40
- @vueform/multiselect version: ^2.6.7
Description
Hi, I'm getting a typescript build error on build my project
the error I'm getting is on the line isSelected(option)
Error:
This expression is not callable. Type 'Boolean' has no call signatures.
Code
<Multiselect
mode="multiple"
:hide-selected="false"
...
>
<template #option="{ option, isSelected }">
<div class="inline-flex items-center space-x-2">
<span v-if="isSelected(option)">
<CheckIcon class="h-5 w-5" />
</span>
<span>{{ option.label }}</span>
</div>
</template>
</Multiselect>
Demo
https://jsfiddle.net/m0dskf24/
for now my workaround is
<Multiselect
mode="multiple"
:hide-selected="false"
...
>
<template #option="{ option, isSelected }">
<div class="inline-flex items-center space-x-2">
<span v-if="//@ts-expect-error
isSelected(option)
">
<CheckIcon class="h-5 w-5" />
</span>
<span>{{ option.label }}</span>
</div>
</template>
</Multiselect>