File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 44
44
45
45
<div v-if =" multiple" class =" el-cascader__tags" >
46
46
<el-tag
47
- v-for =" ( tag, index) in presentTags"
47
+ v-for =" tag in presentTags"
48
48
:key =" tag.key"
49
49
type =" info"
50
50
:size =" tagSize"
51
51
:hit =" tag.hitState"
52
52
:closable =" tag.closable"
53
53
disable-transitions
54
- @close =" deleteTag(index )" >
54
+ @close =" deleteTag(tag )" >
55
55
<span >{{ tag.text }}</span >
56
56
</el-tag >
57
57
<input
@@ -588,7 +588,7 @@ export default {
588
588
589
589
if (this .pressDeleteCount ) {
590
590
if (lastTag .hitState ) {
591
- this .deleteTag (lastIndex );
591
+ this .deleteTag (lastTag );
592
592
} else {
593
593
lastTag .hitState = true ;
594
594
}
@@ -607,10 +607,11 @@ export default {
607
607
this .toggleDropDownVisible (false );
608
608
}
609
609
},
610
- deleteTag (index ) {
610
+ deleteTag (tag ) {
611
611
const { checkedValue } = this ;
612
- const val = checkedValue[index];
613
- this .checkedValue = checkedValue .filter ((n , i ) => i !== index);
612
+ const current = tag .node .getValueByOption ();
613
+ const val = checkedValue .find (n => isEqual (n, current));
614
+ this .checkedValue = checkedValue .filter (n => ! isEqual (n, current));
614
615
this .$emit (' remove-tag' , val);
615
616
},
616
617
updateStyle () {
You can’t perform that action at this time.
0 commit comments