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
  • Loading branch information
candersony committed Jan 20, 2024
1 parent 332933c commit d611b37
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 d611b37

Please sign in to comment.