Select: fix delete-tag

pull/3801/head
pcf 2017-03-23 11:28:26 +08:00 committed by 杨奕
parent a3dca68fb0
commit 954caf12bc
2 changed files with 3 additions and 3 deletions

View File

@ -647,7 +647,7 @@ Create and select new items that are not included in select options
|---------|---------|---------| |---------|---------|---------|
| change | triggers when the selected value changes | current selected value | | change | triggers when the selected value changes | current selected value |
| visible-change | triggers when the dropdown appears/disappears | true when it appears, and false otherwise | | visible-change | triggers when the dropdown appears/disappears | true when it appears, and false otherwise |
| delete-tag | triggers when deletes tag in multiple mode | deleted tag value | | delete-tag | triggers when a tag is deleted in multiple mode | deleted tag value |
### Option Group Attributes ### Option Group Attributes
| Attribute | Description | Type | Accepted Values | Default | | Attribute | Description | Type | Accepted Values | Default |

View File

@ -599,8 +599,8 @@
deleteTag(event, tag) { deleteTag(event, tag) {
let index = this.selected.indexOf(tag); let index = this.selected.indexOf(tag);
if (index > -1 && !this.disabled) { if (index > -1 && !this.disabled) {
let deletedTag = this.value.splice(index, 1)[0]; this.value.splice(index, 1);
this.$emit('delete-tag', deletedTag); this.$emit('delete-tag', tag);
} }
event.stopPropagation(); event.stopPropagation();
}, },