diff --git a/src/components/tag/tag.vue b/src/components/tag/tag.vue index 1984e69..0754d2b 100644 --- a/src/components/tag/tag.vue +++ b/src/components/tag/tag.vue @@ -1,8 +1,7 @@ @@ -71,17 +70,20 @@ }, methods: { close (event) { - this._emitAction(event, 'on-close'); - }, - check (event) { - this.isChecked = !this.isChecked; - this._emitAction(event, 'on-check'); + if (this.name === undefined) { + this.$emit('on-close', event); + } else { + this.$emit('on-close', event, this.name); + } }, - _emitAction (event, action) { + check () { + if (!this.checkable) return; + const checked = !this.isChecked; + this.isChecked = checked; if (this.name === undefined) { - this.$emit(action, event); + this.$emit('on-change', checked); } else { - this.$emit(action, event, this.name); + this.$emit('on-change', checked, this.name); } } } -- libgit2 0.21.4