add event 'on-click' for Tag
This commit is contained in:
parent
ca13135480
commit
2c6c41be34
1 changed files with 8 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
<div :class="classes">
|
<div :class="classes" @click.native.stop="clickTag">
|
||||||
<span :class="dotClasses" v-if="showDot"></span><span :class="textClasses"><slot></slot></span><Icon v-if="closable" type="ios-close-empty" @click.native.stop="close"></Icon>
|
<span :class="dotClasses" v-if="showDot"></span><span :class="textClasses"><slot></slot></span><Icon v-if="closable" type="ios-close-empty" @click.native.stop="close"></Icon>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -61,6 +61,13 @@
|
||||||
} else {
|
} else {
|
||||||
this.$emit('on-close', event, this.name);
|
this.$emit('on-close', event, this.name);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
clickTag (event) {
|
||||||
|
if (this.name === undefined) {
|
||||||
|
this.$emit('on-click', event);
|
||||||
|
} else {
|
||||||
|
this.$emit('on-click', event, this.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue