Browse Source

style: remove duplicate func (#3924)

pull/3775/head
zkwolf 4 years ago committed by GitHub
parent
commit
44e73cf460
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      components/badge/Badge.tsx
  2. 2
      components/badge/utils.ts

5
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',

2
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;
}

Loading…
Cancel
Save