rename delete-tag to remove-tag

pull/3801/head
pcf 2017-03-24 16:57:22 +08:00 committed by 杨奕
parent 954caf12bc
commit 04fa32a8d0
4 changed files with 7 additions and 7 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 |
| visible-change | triggers when the dropdown appears/disappears | true when it appears, and false otherwise |
| delete-tag | triggers when a tag is deleted in multiple mode | deleted tag value |
| remove-tag | triggers when a tag is removed in multiple mode | removed tag value |
### Option Group Attributes
| Attribute | Description | Type | Accepted Values | Default |

View File

@ -648,7 +648,7 @@
|---------|---------|---------|
| change | 选中值发生变化时触发 | 目前的选中值 |
| visible-change | 下拉框出现/隐藏时触发 | 出现则为 true隐藏则为 false |
| delete-tag | 多选模式下删除tag时触发 | 删除的tag值 |
| remove-tag | 多选模式下移除tag时触发 | 移除的tag值 |
### Option Group Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 |

View File

@ -600,7 +600,7 @@
let index = this.selected.indexOf(tag);
if (index > -1 && !this.disabled) {
this.value.splice(index, 1);
this.$emit('delete-tag', tag);
this.$emit('remove-tag', tag);
}
event.stopPropagation();
},

View File

@ -442,12 +442,12 @@ describe('Select', () => {
}, 100);
});
it('multiple delete-tag', done => {
it('multiple remove-tag', done => {
sinon.stub(window.console, 'log');
vm = createVue({
template: `
<div>
<el-select v-model="value" multiple @delete-tag="handleDeleteTag">
<el-select v-model="value" multiple @remove-tag="handleRemoveTag">
<el-option
v-for="item in options"
:label="item.label"
@ -481,8 +481,8 @@ describe('Select', () => {
},
methods: {
handleDeleteTag() {
console.log('delete tag');
handleRemoveTag() {
console.log('remove tag');
}
}
}, true);