remark classname调整下、验证问题修复

This commit is contained in:
rickcole 2020-07-03 17:27:30 +08:00
parent 9e3641571c
commit cd84553cef
2 changed files with 3 additions and 7 deletions

View File

@ -66,16 +66,12 @@ class Remark extends React.Component<RemarkProps> {
const finalIcon = (tooltip && tooltip.icon) || icon;
return (
<div
className={cx(
`Remark`,
(tooltip && tooltip.className) || className || `Remark--warning`
)}
>
<div className={cx(`Remark`, className || `Remark--warning`)}>
<TooltipWrapper
classPrefix={ns}
classnames={cx}
tooltip={filterContents(tooltip || content, data)}
tooltipClassName={tooltip && tooltip.className}
placement={(tooltip && tooltip.placement) || placement}
rootClose={(tooltip && tooltip.rootClose) || rootClose}
trigger={(tooltip && tooltip.trigger) || trigger}

View File

@ -259,7 +259,7 @@ export function validate(
rules &&
Object.keys(rules).forEach(ruleName => {
if (!rules[ruleName]) {
if (!isExisty(rules[ruleName]) || isEmpty(rules[ruleName])) {
return;
} else if (typeof validations[ruleName] !== 'function') {
throw new Error('Validation `' + ruleName + '` not exists!');