Skip to content

Commit

Permalink
fix(vue-compat): Ensure getDefaultSlots works with @vue/compat & Vue 3 (
Browse files Browse the repository at this point in the history
#6016)

fix(vue-instantsearch): Ensure getDefaultSlots works with @vue/compat & Vue 3
  • Loading branch information
candersony committed Jan 29, 2024
1 parent 7d82b01 commit e270069
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/vue-instantsearch/src/util/vue-compat/index-vue3.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,13 @@ export function renderCompat(fn) {
}

export function getDefaultSlot(component) {
return component.$slots.default && component.$slots.default();
const $slots = component.$slots || component.slots;

if (typeof $slots.default === 'function') {
// Vue 3
return $slots.default();
}

// Vue 3 with @vue/compat
return $slots.default;
}

0 comments on commit e270069

Please sign in to comment.