2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-19 09:50:33 +03:00

feat: Vue 3 Support (#1344)

BREAKING CHANGE: drop vue 2 support
This commit is contained in:
Jeff Sagal
2021-10-19 18:53:22 -07:00
committed by GitHub
parent e8d7abbf33
commit 06177a4d24
29 changed files with 774 additions and 561 deletions
+9 -10
View File
@@ -13,7 +13,7 @@ export const searchSubmit = (Wrapper, searchText = false) => {
if (searchText) {
Wrapper.vm.search = searchText
}
Wrapper.findComponent({ ref: 'search' }).trigger('keydown.enter')
Wrapper.get('input').trigger('keydown.enter')
}
/**
@@ -29,18 +29,17 @@ export const selectTag = async (Wrapper, searchText) => {
Wrapper.vm.search = searchText
await Wrapper.vm.$nextTick()
Wrapper.findComponent({ ref: 'search' }).trigger('keydown.enter')
await Wrapper.vm.$nextTick()
await Wrapper.get('input').trigger('keydown.enter')
}
/**
* Create a new VueSelect instance with
* a provided set of props.
* @param propsData
* @param props
* @returns {Wrapper<Vue>}
*/
export const selectWithProps = (propsData = {}) => {
return shallowMount(VueSelect, { propsData })
export const selectWithProps = (props = {}) => {
return shallowMount(VueSelect, { props })
}
/**
@@ -51,7 +50,7 @@ export const selectWithProps = (propsData = {}) => {
*/
export const mountDefault = (props = {}, options = {}) => {
return shallowMount(VueSelect, {
propsData: {
props: {
options: ['one', 'two', 'three'],
...props,
},
@@ -66,13 +65,13 @@ export const mountDefault = (props = {}, options = {}) => {
* @return {Vue | Element | Vue[] | Element[]}
*/
export const mountWithoutTestUtils = (props = {}, options = {}) => {
return new Vue({
components: { VueSelect },
return createApp({
render: (createEl) =>
createEl('vue-select', {
ref: 'select',
props: { options: ['one', 'two', 'three'], ...props },
...options,
}),
}).$mount().$refs.select
components: { VueSelect },
}).mount().$refs.select
}