From 179bb5c346155878add2c9f16f00f3a080eedf2f Mon Sep 17 00:00:00 2001 From: nanotronic Date: Thu, 24 Mar 2016 16:01:09 +0100 Subject: [PATCH] use es6 spread --- src/components/Select.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index bbd0d09..ad23687 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -294,7 +294,7 @@ this.onChange && val !== old ? this.onChange(val) : null }, options() { - if (!this.optionAdded) { + if (!this.isAdding) { this.$set('value', this.multiple ? [] : null) } }, @@ -443,11 +443,11 @@ this.select( this.filteredOptions[ this.typeAheadPointer ] ); } else if (this.tagable && this.search.length){ let option = this.createOption(this.search) - this.optionAdded = true - this.options.unshift(option) + this.isAdding = true + this.$set('options', [option, ...this.options]) this.$nextTick(() => { - this.optionAdded = false this.select(option) + this.isAdding = false }) }