salt-ui / saltui

MIT License
238 stars 64 forks source link

Field组件 #410

Open KelWenGek opened 3 years ago

KelWenGek commented 3 years ago

请按照以下模板填写,不按照标准模板填写的 issue 将降低处理优先级。

这是一个

SaltUI 版本

4.10.6

浏览器、操作系统等环境信息

复现步骤

showErrInTip为false之后,错误信息是会在toast里展示,但是原来展示tip的地方也会被替换成errMsg. 看了下renderTip方法里的message取值是优先errMsg变量. 能否改成根据hasError来决定message是取errMsg变量还是tip变量 renderTip() { const t = this; const { readOnly, disabled, tip, errMsg, showErrInTip, layout, } = t.props; if (!readOnly && !disabled && (tip || (errMsg && showErrInTip))) { const message = errMsg || tip; const hasError = errMsg && showErrInTip; return ( <div className={classnames(prefixClass('field-box FBH field-tip-box'), {

    })}
    >
      {layout === 'h' ? t.renderLabel({ className: prefixClass('field-tip-placeholder') }) : null}
      <div className={prefixClass('FBH FBAC LH1_5 field-tip')}>{message}</div>
    </div>
  );
}
return null;

}

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.