diff --git a/components/badge/Badge.tsx b/components/badge/Badge.tsx index 90afca47c..4a3b263de 100644 --- a/components/badge/Badge.tsx +++ b/components/badge/Badge.tsx @@ -1,6 +1,5 @@ import PropTypes from '../_util/vue-types'; import ScrollNumber from './ScrollNumber'; -import { PresetColorTypes } from '../_util/colors'; import classNames from '../_util/classNames'; import { initDefaultProps, getComponent, getSlot } from '../_util/props-util'; import { cloneElement } from '../_util/vnode'; @@ -10,6 +9,7 @@ import { defaultConfigProvider } from '../config-provider'; import { inject, defineComponent, CSSProperties, VNode, App, Plugin } from 'vue'; import { tuple } from '../_util/type'; import Ribbon from './Ribbon'; +import { isPresetColor } from './utils'; const BadgeProps = { /** Number to show in badge */ @@ -28,9 +28,6 @@ const BadgeProps = { numberStyle: PropTypes.style, title: PropTypes.string, }; -function isPresetColor(color?: string): boolean { - return (PresetColorTypes as string[]).indexOf(color) !== -1; -} const Badge = defineComponent({ name: 'ABadge', diff --git a/components/badge/utils.ts b/components/badge/utils.ts index 21bebac2e..de602ff63 100644 --- a/components/badge/utils.ts +++ b/components/badge/utils.ts @@ -1,5 +1,5 @@ import { PresetColorTypes } from '../_util/colors'; export function isPresetColor(color?: string): boolean { - return (PresetColorTypes as any[]).indexOf(color) !== -1; + return (PresetColorTypes as string[]).indexOf(color) !== -1; }