From 30c1b9d397c0eb11851e1087003ccd528f846dd5 Mon Sep 17 00:00:00 2001 From: FEI <1556610925@qq.com> Date: Wed, 15 Feb 2023 14:57:25 +0800 Subject: [PATCH] select --- src/components/select/select.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 8c350e4..a30d6f0 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -266,6 +266,23 @@ } this.checkUpdateStatus(); + + // remote search, set instanceof + if (this.remote && this.value && this.initialLabel) { + if (!this.multiple) { + this.query = this.initialLabel; + } else if (this.multiple && (this.initialLabel instanceof Array) && this.value.length === this.initialLabel.length) { + const values = this.value.map((item, index) => { + return { + value: item, + label: this.initialLabel[index] + }; + }); + setTimeout(() => { + this.values = values; + }); + } + } }, data () { -- libgit2 0.21.4