未验证 提交 1cfa7279 编写于 作者: J junjun666 提交者: GitHub

fix: 修改steps点击报错和eslint校验报错 (#179)

上级 aa32a9c4
......@@ -50,7 +50,9 @@ export const Step: FunctionComponent<
return index === +parent.propSteps.current ? 'process' : 'wait'
}
const handleClickStep = () => {
parent.propSteps?.clickStep(activeIndex)
if (parent.propSteps?.clickStep) {
parent.propSteps?.clickStep(activeIndex)
}
}
const b = bem('step')
......@@ -61,15 +63,21 @@ export const Step: FunctionComponent<
className,
b('')
)
const renderIconClass = () => {
if (!dot && icon) {
return 'nut-step-icon is-icon'
}
if (!dot && !icon) {
return 'nut-step-icon is-text'
}
return 'nut-step-icon'
}
return (
<div className={classes} {...restProps} onClick={handleClickStep}>
<div className="nut-step-head">
<div className="nut-step-line" />
<div
className={`nut-step-icon ${
!dot ? (icon ? 'is-icon' : 'is-text') : ''
}`}
>
<div className={renderIconClass()}>
{icon ? (
<Icon
className="nut-step-icon-inner"
......@@ -77,10 +85,8 @@ export const Step: FunctionComponent<
name={icon}
size={size}
/>
) : dot ? (
<span />
) : (
<span className="nut-step-inner">{activeIndex}</span>
!dot && <span className="nut-step-inner">{activeIndex}</span>
)}
</div>
</div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册