From 47e75410a9a53a3feebd9b65b3558c4deec8cc32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Sat, 4 May 2019 16:45:10 +0800 Subject: [PATCH] [improvement] Tag: optimize type definitions --- packages/icon/index.tsx | 2 +- packages/tag/index.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/icon/index.tsx b/packages/icon/index.tsx index 1e3a45f27..5fd21b490 100644 --- a/packages/icon/index.tsx +++ b/packages/icon/index.tsx @@ -10,7 +10,7 @@ import { DefaultSlots } from '../utils/use/sfc'; export type IconProps = { tag: keyof HTMLElementTagNameMap | string; name: string; - size?: string; + size?: string | number; color?: string; info?: string | number; classPrefix: string; diff --git a/packages/tag/index.tsx b/packages/tag/index.tsx index 4d773c475..77ec4d73f 100644 --- a/packages/tag/index.tsx +++ b/packages/tag/index.tsx @@ -6,9 +6,13 @@ import { RED, BLUE, GREEN, GRAY_DARK } from '../utils/color'; import { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../utils/use/sfc'; +export type TagType = 'primary' | 'success' | 'danger'; + +export type TagSize = 'large' | 'medium'; + export type TagProps = { - size?: string; - type?: string; + size?: TagSize; + type?: TagType; mark?: boolean; color?: string; plain?: boolean;