mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +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>
|
</div>
|
||||||
<transition :name="transition">
|
<transition :name="transition">
|
||||||
<DropdownMenu>
|
<DropdownMenu>
|
||||||
<slot name="list-header" v-bind="scope.listHeader" />
|
|
||||||
<li
|
<li
|
||||||
v-for="(option, index) in filteredOptions"
|
v-for="(option, index) in filteredOptions"
|
||||||
:id="`vs${uid}__option-${index}`"
|
:id="`vs${uid}__option-${index}`"
|
||||||
@@ -111,7 +110,6 @@
|
|||||||
Sorry, no matching options.
|
Sorry, no matching options.
|
||||||
</slot>
|
</slot>
|
||||||
</li>
|
</li>
|
||||||
<slot name="list-footer" v-bind="scope.listFooter" />
|
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
</transition>
|
</transition>
|
||||||
<slot name="footer" v-bind="scope.footer" />
|
<slot name="footer" v-bind="scope.footer" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { it, describe, expect, vi, beforeEach, afterEach } from 'vitest'
|
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 VueSelect from '@/components/Select.vue'
|
||||||
import typeAheadPointer from '@/mixins/typeAheadPointer.js'
|
import typeAheadPointer from '@/mixins/typeAheadPointer.js'
|
||||||
import { mountDefault } from '@tests/helpers.js'
|
import { mountDefault } from '@tests/helpers.js'
|
||||||
|
|||||||
@@ -123,40 +123,4 @@ describe('Scoped Slots', () => {
|
|||||||
'deselect',
|
'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