feat(Cascader): add close icon

This commit is contained in:
chenjiahan
2020-12-20 21:23:50 +08:00
committed by neverland
parent 347758a935
commit 5d2bd8f6df
3 changed files with 21 additions and 1 deletions
+11
View File
@@ -81,10 +81,21 @@ export default createComponent({
}
},
onClose() {
this.$emit('close');
},
renderHeader() {
return (
<div class={bem('header')}>
<h2 class={bem('title')}>{this.slots('title') || this.title}</h2>
{this.closeable ? (
<Icon
name="cross"
class={bem('close-icon')}
onClick={this.onClose}
/>
) : null}
</div>
);
},