Commit e44bf50e authored by kingwl's avatar kingwl Committed by 杨奕

Select: fix clear on remote mode

parent 2f373551
...@@ -97,16 +97,19 @@ ...@@ -97,16 +97,19 @@
let criteria = this.clearable && this.inputHovering && !this.multiple && this.options.indexOf(this.selected) > -1; let criteria = this.clearable && this.inputHovering && !this.multiple && this.options.indexOf(this.selected) > -1;
if (!this.$el) return false; if (!this.$el) return false;
let icon = this.$el.querySelector('.el-input__icon'); this.$nextTick(() => {
if (icon) { let icon = this.$el.querySelector('.el-input__icon');
if (criteria) { if (icon) {
icon.addEventListener('click', this.deleteSelected); if (criteria) {
addClass(icon, 'is-show-close'); icon.addEventListener('click', this.deleteSelected);
} else { addClass(icon, 'is-show-close');
icon.removeEventListener('click', this.deleteSelected); } else {
removeClass(icon, 'is-show-close'); icon.removeEventListener('click', this.deleteSelected);
removeClass(icon, 'is-show-close');
}
} }
} });
return criteria; return criteria;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment