Skip to content

Commit 44e73cf

Browse files
authored
style: remove duplicate func (#3924)
1 parent efb382c commit 44e73cf

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

components/badge/Badge.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import PropTypes from '../_util/vue-types';
22
import ScrollNumber from './ScrollNumber';
3-
import { PresetColorTypes } from '../_util/colors';
43
import classNames from '../_util/classNames';
54
import { initDefaultProps, getComponent, getSlot } from '../_util/props-util';
65
import { cloneElement } from '../_util/vnode';
@@ -10,6 +9,7 @@ import { defaultConfigProvider } from '../config-provider';
109
import { inject, defineComponent, CSSProperties, VNode, App, Plugin } from 'vue';
1110
import { tuple } from '../_util/type';
1211
import Ribbon from './Ribbon';
12+
import { isPresetColor } from './utils';
1313

1414
const BadgeProps = {
1515
/** Number to show in badge */
@@ -28,9 +28,6 @@ const BadgeProps = {
2828
numberStyle: PropTypes.style,
2929
title: PropTypes.string,
3030
};
31-
function isPresetColor(color?: string): boolean {
32-
return (PresetColorTypes as string[]).indexOf(color) !== -1;
33-
}
3431

3532
const Badge = defineComponent({
3633
name: 'ABadge',

components/badge/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PresetColorTypes } from '../_util/colors';
22

33
export function isPresetColor(color?: string): boolean {
4-
return (PresetColorTypes as any[]).indexOf(color) !== -1;
4+
return (PresetColorTypes as string[]).indexOf(color) !== -1;
55
}

0 commit comments

Comments
 (0)