-
Notifications
You must be signed in to change notification settings - Fork 151
Open
Labels
Description
Version
- Vue version: 3
- Multiselect version: 2.6.1
Description
I wrapped the Multiselect in a component called FormMultiselect.vue:
<template>
<Multiselect v-bind="$attrs" no-options-text="Lista vuota">
<template v-for="(_, slot) of $slots" #[slot]="scope">
<slot :name="slot" v-bind="scope" />
</template>
</Multiselect>
</template>
<script setup>
import Multiselect from "@vueform/multiselect";
</script>
When I try to use this component passing a slot option,
<template>
...
<FormMultiselect ... :options="[...]">
<template #option="{ option }">{{ option.name }}...</template>
</FormMultiselect>
</template>
Something strange happened on server side render (Nuxt 3):
[Vue warn]: Property "slot" was accessed during render but is not defined on instance. (repeated for every option)
If I replace the loop for templates in the FormMultiselect.vue with the specific list of slots, no warnings!
<template>
<Multiselect v-bind="$attrs" no-options-text="Lista vuota">
<template #option="scope">
<slot name="option" v-bind="scope" />
</template>
</Multiselect>
</template>
<script setup>
import Multiselect from "@vueform/multiselect";
</script>
This happens just with this component, I tried creating a brand new component and its own wrapper and it works well.
Can you help me debug this warning?
Thanks in advance