Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript Build Error #403

Open
redbayoub opened this issue Apr 21, 2024 · 1 comment · May be fixed by #408
Open

Typescript Build Error #403

redbayoub opened this issue Apr 21, 2024 · 1 comment · May be fixed by #408

Comments

@redbayoub
Copy link

redbayoub commented Apr 21, 2024

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
Copy link
Author

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant