2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

remove list-header and list-footer slots

BREAKING: list-header and list-footer have been removed. If you were using these slots, you can instead compose your own dropdown menu.
This commit is contained in:
Jeff Sagal
2022-11-30 11:36:20 -08:00
parent 0965d602c4
commit c32b08dd13
3 changed files with 1 additions and 39 deletions
-2
View File
@@ -84,7 +84,6 @@
</div>
<transition :name="transition">
<DropdownMenu>
<slot name="list-header" v-bind="scope.listHeader" />
<li
v-for="(option, index) in filteredOptions"
:id="`vs${uid}__option-${index}`"
@@ -111,7 +110,6 @@
Sorry, no matching options.
</slot>
</li>
<slot name="list-footer" v-bind="scope.listFooter" />
</DropdownMenu>
</transition>
<slot name="footer" v-bind="scope.footer" />
+1 -1
View File
@@ -1,5 +1,5 @@
import { it, describe, expect, vi, beforeEach, afterEach } from 'vitest'
import { mount, mount } from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import VueSelect from '@/components/Select.vue'
import typeAheadPointer from '@/mixins/typeAheadPointer.js'
import { mountDefault } from '@tests/helpers.js'
-36
View File
@@ -123,40 +123,4 @@ describe('Scoped Slots', () => {
'deselect',
])
})
test('list-header slot props', async () => {
const header = vi.fn()
const Select = mountDefault(
{},
{
slots: { 'list-header': header },
}
)
Select.vm.open = true
await Select.vm.$nextTick()
expect(Object.keys(header.mock.calls[0][0])).toEqual([
'search',
'loading',
'searching',
'filteredOptions',
])
})
test('list-footer slot props', async () => {
const footer = vi.fn()
const Select = mountDefault(
{},
{
slots: { 'list-footer': footer },
}
)
Select.vm.open = true
await Select.vm.$nextTick()
expect(Object.keys(footer.mock.calls[0][0])).toEqual([
'search',
'loading',
'searching',
'filteredOptions',
])
})
})