Skip to content

Commit

Permalink
feat: use common isValidSize
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Sep 10, 2024
1 parent b145679 commit 31243b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/avatar/avatar-group.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { computed, defineComponent, Fragment, provide, RendererNode } from 'vue';
import AvatarGroupProps from './avatar-group-props';
import config from '../config';
import TAvatar, { isValidSize } from './avatar';
import TAvatar from './avatar';
import { useTNodeJSX } from '../hooks/tnode';
import { usePrefixClass } from '../hooks/useClass';
import { isValidSize } from '../_common/js/avatar/utils';

const { prefix } = config;
const name = `${prefix}-avatar-group`;
Expand Down
5 changes: 1 addition & 4 deletions src/avatar/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@ import AvatarProps from './props';
import { TdAvatarGroupProps, TdAvatarProps } from './type';
import { useContent, useTNodeJSX } from '../hooks/tnode';
import { usePrefixClass } from '../hooks/useClass';
import { isValidSize } from '../_common/js/avatar/utils';

const { prefix } = config;
const name = `${prefix}-avatar`;

export const isValidSize = (value: string): boolean => {
return ['small', 'medium', 'large'].includes(value);
};

export default defineComponent({
name,
props: AvatarProps,
Expand Down

0 comments on commit 31243b8

Please sign in to comment.