multiselect icon indicating copy to clipboard operation
multiselect copied to clipboard

Typescript Build Error

Open redbayoub opened this issue 1 year ago • 1 comments

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/

redbayoub avatar Apr 21 '24 11:04 redbayoub

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>

redbayoub avatar Apr 21 '24 11:04 redbayoub