feat(Popup): add click-close-icon event (#7599)

This commit is contained in:
neverland
2020-11-21 18:36:23 +08:00
committed by GitHub
parent 5605b0aa57
commit b53254e33a
4 changed files with 38 additions and 17 deletions
+8 -1
View File
@@ -44,6 +44,13 @@ export default createComponent({
this.onClosed = createEmitter('closed');
},
methods: {
onClickCloseIcon(event) {
this.$emit('click-close-icon', event);
this.close();
},
},
render() {
if (!this.shouldRender) {
return;
@@ -86,7 +93,7 @@ export default createComponent({
tabindex="0"
name={this.closeIcon}
class={bem('close-icon', this.closeIconPosition)}
onClick={this.close}
onClick={this.onClickCloseIcon}
/>
)}
</div>