diff --git a/packages/components/Button/button.ts b/packages/components/Button/button.ts index a0e591a..be545f4 100644 --- a/packages/components/Button/button.ts +++ b/packages/components/Button/button.ts @@ -1,5 +1,7 @@ +import { ViBaseSizes, ViBaseTypes } from '../types' + export interface ButtonProps { - type?: 'primary' | 'success' | 'info' | 'warning' | 'danger' + type?: ViBaseTypes text?: boolean round?: boolean circle?: boolean @@ -9,7 +11,7 @@ export interface ButtonProps { bgColor?: string color?: string plain?: boolean - size?: 'small' | 'normal' | 'large' + size?: ViBaseSizes disableShadow?: boolean } diff --git a/packages/components/Link/link.ts b/packages/components/Link/link.ts index 008e994..bda1a55 100644 --- a/packages/components/Link/link.ts +++ b/packages/components/Link/link.ts @@ -1,5 +1,7 @@ +import { ViBaseTypes } from '../types' + export interface LinkProps { - type?: 'primary' | 'success' | 'warning' | 'danger' + type?: Omit disabled?: boolean underline?: boolean } @@ -12,4 +14,4 @@ export interface LinkSlots { default?: (props: {}) => any prefix?: (props: {}) => any suffix?: (props: {}) => any -} \ No newline at end of file +} diff --git a/packages/components/Switch/switch.ts b/packages/components/Switch/switch.ts index cf45cbf..20a51c5 100644 --- a/packages/components/Switch/switch.ts +++ b/packages/components/Switch/switch.ts @@ -1,3 +1,5 @@ +import { ViBaseSizes } from '../types' + export interface SwitchProps { modelValue: boolean disabled?: boolean @@ -10,7 +12,7 @@ export interface SwitchProps { onIcon?: string offIcon?: string width?: string - size?: 'small' | 'normal' | 'large' + size?: ViBaseSizes } export interface SwitchEmits { @@ -26,4 +28,4 @@ export type SwitchTexts = ['onText', 'offText'] export interface SwitchSlots { on?: (props: {}) => any off?: (props: {}) => any -} \ No newline at end of file +} diff --git a/packages/components/Tag/tag.ts b/packages/components/Tag/tag.ts index 3f385e6..417c0ac 100644 --- a/packages/components/Tag/tag.ts +++ b/packages/components/Tag/tag.ts @@ -1,5 +1,7 @@ +import { ViBaseTypes } from '../types' + export interface TagProps { - type?: 'primary' | 'success' | 'info' | 'warning' | 'danger' + type?: ViBaseTypes border?: boolean closable?: boolean disabled?: boolean @@ -12,4 +14,4 @@ export interface TagEmits { export interface TagSlots { default?: (props: {}) => any -} \ No newline at end of file +} diff --git a/packages/components/types.ts b/packages/components/types.ts new file mode 100644 index 0000000..14b7aef --- /dev/null +++ b/packages/components/types.ts @@ -0,0 +1,5 @@ +/** violet 基础类型 */ +export type ViBaseTypes = 'primary' | 'success' | 'info' | 'warning' | 'danger' + +/** violet 基础尺寸 */ +export type ViBaseSizes = 'small' | 'normal' | 'large'