diff --git a/packages/select/src/option.vue b/packages/select/src/option.vue index 0ecf89af9..a4a0fe3ba 100644 --- a/packages/select/src/option.vue +++ b/packages/select/src/option.vue @@ -121,6 +121,7 @@ created() { this.parent.options.push(this); + if (this.parent.remote) this.parent.cachedOptions.push(this); this.parent.optionsCount++; this.parent.filteredOptionsCount++; this.index = this.parent.options.indexOf(this); diff --git a/packages/select/src/select.vue b/packages/select/src/select.vue index 77c6220a5..2f003fba2 100644 --- a/packages/select/src/select.vue +++ b/packages/select/src/select.vue @@ -183,6 +183,7 @@ data() { return { options: [], + cachedOptions: [], selected: this.multiple ? [] : {}, isSelect: true, inputLength: 20, @@ -337,7 +338,8 @@ }, getOption(value) { - const option = this.options.filter(option => option.value === value)[0]; + const option = (this.remote ? this.cachedOptions : this.options) + .filter(option => option.value === value)[0]; if (option) return option; const label = typeof value === 'string' || typeof value === 'number' ? value : '';