From 254f3bece9b129c963278f5b8b32990768501dce Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Thu, 9 Feb 2023 08:04:05 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=99=A8=E7=BB=84=E4=BB=B6=E5=80=BC=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/components/customSelect/index.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/customSelect/index.vue b/src/components/customSelect/index.vue index a62ab1d..e6db220 100644 --- a/src/components/customSelect/index.vue +++ b/src/components/customSelect/index.vue @@ -83,6 +83,12 @@ import { Select } from 'ant-design-vue' }, methods: { - + refreshSelect() { + this.$emit('onRefreshSelect') + }, + selectChange(v) { + this.$emit('input', v) + this.selectOpen = false + }, } -- Gitee From f0fd6d0210fadbe710d22553e5b3737a338611e8 Mon Sep 17 00:00:00 2001 From: Dong Xia Date: Thu, 9 Feb 2023 08:05:06 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=80=89=E6=8B=A9=E5=99=A8=E7=BB=84=E4=BB=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dong Xia --- src/components/customSelect/index.vue | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/components/customSelect/index.vue b/src/components/customSelect/index.vue index e6db220..308bbdf 100644 --- a/src/components/customSelect/index.vue +++ b/src/components/customSelect/index.vue @@ -90,5 +90,33 @@ import { Select } from 'ant-design-vue' 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 + } } -- Gitee