diff --git a/src/components/customSelect/index.vue b/src/components/customSelect/index.vue index a62ab1d7da647d10835f823ea1952853a01bcbfa..308bbdf602d4112e9b1b813d15e937c88a821a6b 100644 --- a/src/components/customSelect/index.vue +++ b/src/components/customSelect/index.vue @@ -83,6 +83,40 @@ import { Select } from 'ant-design-vue' }, methods: { - + refreshSelect() { + this.$emit('onRefreshSelect') + }, + selectChange(v) { + this.$emit('input', v) + this.selectOpen = false + }, + onSearch(v) { + if (!v) { + return + } + let index = this.optionList.indexOf(v) + if (index === -1) { + this.optionList = [...this.optionList, v] + } + this.selectInput = '' + this.selected = v + this.selectChange(v) + }, + setSelectOpen(v) { + this.selectFocus = v + if (this.inputFocus || this.selectFocus) { + this.selectOpen = true + return + } + this.selectOpen = false + }, + visibleInput(v) { + this.inputFocus = v + if (this.inputFocus || this.selectFocus) { + this.selectOpen = true + return + } + this.selectOpen = false + } }