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:
@@ -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,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'
|
||||
|
||||
@@ -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',
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user