mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
feat(Steps): add click-step event (#5937)
This commit is contained in:
@@ -17,6 +17,7 @@ export default createComponent({
|
||||
return 'process';
|
||||
}
|
||||
},
|
||||
|
||||
active() {
|
||||
return this.status === 'process';
|
||||
},
|
||||
@@ -48,6 +49,10 @@ export default createComponent({
|
||||
|
||||
return <i class={bem('circle')} />;
|
||||
},
|
||||
|
||||
onClickStep() {
|
||||
this.parent.$emit('click-step', this.index);
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
@@ -59,10 +64,16 @@ export default createComponent({
|
||||
|
||||
return (
|
||||
<div class={[BORDER, bem([direction, { [status]: status }])]}>
|
||||
<div class={bem('title', { active })} style={titleStyle}>
|
||||
<div
|
||||
class={bem('title', { active })}
|
||||
style={titleStyle}
|
||||
onClick={this.onClickStep}
|
||||
>
|
||||
{this.slots()}
|
||||
</div>
|
||||
<div class={bem('circle-container')}>{this.genCircle()}</div>
|
||||
<div class={bem('circle-container')} onClick={this.onClickStep}>
|
||||
{this.genCircle()}
|
||||
</div>
|
||||
<div class={bem('line')} style={lineStyle} />
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user