From 2e419b264b0d258b3fc00ece2613e17dd32987fc Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 11 Feb 2020 10:48:21 +0800 Subject: [PATCH] :lipstick: fix Badge function name close #20253 --- components/badge/index.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/badge/index.tsx b/components/badge/index.tsx index 70981eb620..728380b5d5 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -39,20 +39,20 @@ export default class Badge extends React.Component { overflowCount: 99, }; - getNumberedDispayCount() { + getNumberedDisplayCount() { const { count, overflowCount } = this.props; const displayCount = (count as number) > (overflowCount as number) ? `${overflowCount}+` : count; return displayCount as string | number | null; } - getDispayCount() { + getDisplayCount() { const isDot = this.isDot(); // dot mode don't need count if (isDot) { return ''; } - return this.getNumberedDispayCount(); + return this.getNumberedDisplayCount(); } getScrollNumberTitle() { @@ -89,8 +89,8 @@ export default class Badge extends React.Component { } isZero() { - const numberedDispayCount = this.getNumberedDispayCount(); - return numberedDispayCount === '0' || numberedDispayCount === 0; + const numberedDisplayCount = this.getNumberedDisplayCount(); + return numberedDisplayCount === '0' || numberedDisplayCount === 0; } isDot() { @@ -101,7 +101,7 @@ export default class Badge extends React.Component { isHidden() { const { showZero } = this.props; - const displayCount = this.getDispayCount(); + const displayCount = this.getDisplayCount(); const isZero = this.isZero(); const isDot = this.isDot(); const isEmpty = displayCount === null || displayCount === undefined || displayCount === ''; @@ -114,7 +114,7 @@ export default class Badge extends React.Component { return hidden || !text ? null : {text}; } - renderDispayComponent() { + renderDisplayComponent() { const { count } = this.props; const customNode = count as React.ReactElement; if (!customNode || typeof customNode !== 'object') { @@ -131,7 +131,7 @@ export default class Badge extends React.Component { renderBadgeNumber(prefixCls: string, scrollNumberPrefixCls: string) { const { status, count } = this.props; - const displayCount = this.getDispayCount(); + const displayCount = this.getDisplayCount(); const isDot = this.isDot(); const hidden = this.isHidden(); @@ -149,7 +149,7 @@ export default class Badge extends React.Component { data-show={!hidden} className={scrollNumberCls} count={displayCount} - displayComponent={this.renderDispayComponent()} // }> + displayComponent={this.renderDisplayComponent()} // }> title={this.getScrollNumberTitle()} style={this.getStyleWithOffset()} key="scrollNumber"