From 9b535e2a2c258bdf2e80684dfd35eab45000e247 Mon Sep 17 00:00:00 2001 From: qiusen Date: Tue, 10 Oct 2023 09:22:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(badge):=20#2616=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/badge/src/Badge.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/badge/src/Badge.tsx b/packages/ui/badge/src/Badge.tsx index 845bc8613..c23684aa6 100644 --- a/packages/ui/badge/src/Badge.tsx +++ b/packages/ui/badge/src/Badge.tsx @@ -1,4 +1,4 @@ -import React, {forwardRef, useMemo, isValidElement, cloneElement, ReactNode} from 'react' +import React, { forwardRef, useMemo, isValidElement, cloneElement, ReactNode } from 'react' import { cx, getPrefixCls } from '@hi-ui/classname' import { __DEV__, invariant } from '@hi-ui/env' import { HiBaseHTMLProps } from '@hi-ui/core' @@ -8,8 +8,8 @@ import { BadgeTypeEnum } from './types' const _prefix = getPrefixCls('badge') // 支持字符串和 number hover 显示,其他过滤 -const getShowContent = (content: ReactNode)=>{ - if (!['number','string'].includes(typeof content)) return "" +const getShowContent = (content: ReactNode) => { + if (!['number', 'string'].includes(typeof content)) return "" return `${content}` } /**