Commit 30c1b9d397c0eb11851e1087003ccd528f846dd5

Authored by FEI
1 parent f29a59f5

select

Showing 1 changed file with 17 additions and 0 deletions   Show diff stats
src/components/select/select.vue
... ... @@ -266,6 +266,23 @@
266 266 }
267 267  
268 268 this.checkUpdateStatus();
  269 +
  270 + // remote search, set instanceof
  271 + if (this.remote && this.value && this.initialLabel) {
  272 + if (!this.multiple) {
  273 + this.query = this.initialLabel;
  274 + } else if (this.multiple && (this.initialLabel instanceof Array) && this.value.length === this.initialLabel.length) {
  275 + const values = this.value.map((item, index) => {
  276 + return {
  277 + value: item,
  278 + label: this.initialLabel[index]
  279 + };
  280 + });
  281 + setTimeout(() => {
  282 + this.values = values;
  283 + });
  284 + }
  285 + }
269 286 },
270 287 data () {
271 288  
... ...