feat(Col): add click event (#4169)

This commit is contained in:
neverland
2019-08-21 10:14:15 +08:00
committed by GitHub
parent 66f3aac389
commit 6b8fbfb290
4 changed files with 32 additions and 1 deletions
+11 -1
View File
@@ -23,10 +23,20 @@ export default createComponent({
}
},
methods: {
onClick(event) {
this.$emit('click', event);
}
},
render() {
const { span, offset } = this;
return (
<this.tag class={bem({ [span]: span, [`offset-${offset}`]: offset })} style={this.style}>
<this.tag
style={this.style}
class={bem({ [span]: span, [`offset-${offset}`]: offset })}
onClick={this.onClick}
>
{this.slots()}
</this.tag>
);