tag add prop: name
when use v-for to render Tag, you can use ‘name’ prop to close tag
This commit is contained in:
parent
19d4135239
commit
ec4117cb43
3 changed files with 16 additions and 49 deletions
|
@ -58,7 +58,7 @@
|
|||
if (this.padding !== defaultPadding) {
|
||||
return {
|
||||
padding: `${this.padding}px`
|
||||
}
|
||||
};
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
validator (value) {
|
||||
return oneOf(value, ['border', 'dot']);
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: [String, Number]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -52,8 +55,12 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
close (e) {
|
||||
this.$emit('on-close', e);
|
||||
close (event) {
|
||||
if (this.name === undefined) {
|
||||
this.$emit('on-close', event);
|
||||
} else {
|
||||
this.$emit('on-close', event, this.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue