diff --git a/src/components/Select.vue b/src/components/Select.vue index c2523e9..9367c74 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -172,9 +172,9 @@ @@ -463,7 +465,8 @@ ref = val } }) - this.value.$remove(ref) + var index = this.value.indexOf(ref) + this.value.splice(index, 1) } else { this.value = null } @@ -477,7 +480,7 @@ onAfterSelect(option) { if (!this.multiple) { this.open = !this.open - this.$els.search.blur() + this.$refs.search.blur() } if (this.clearSearchOnSelect) { @@ -491,12 +494,12 @@ * @return {void} */ toggleDropdown(e) { - if (e.target === this.$els.openIndicator || e.target === this.$els.search || e.target === this.$els.toggle || e.target === this.$el) { + if (e.target === this.$refs.openIndicator || e.target === this.$refs.search || e.target === this.$refs.toggle || e.target === this.$el) { if (this.open) { - this.$els.search.blur() // dropdown will close on blur + this.$refs.search.blur() // dropdown will close on blur } else { this.open = true - this.$els.search.focus() + this.$refs.search.focus() } } }, @@ -529,7 +532,7 @@ */ onEscape() { if (!this.search.length) { - this.$els.search.blur() + this.$refs.search.blur() } else { this.search = '' } @@ -541,7 +544,7 @@ * @return {this.value} */ maybeDeleteValue() { - if (!this.$els.search.value.length && this.value) { + if (!this.$refs.search.value.length && this.value) { return this.multiple ? this.value.pop() : this.$set('value', null) } },