From 09bc2b3f251f0822277b12f9aae675549f70141e Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 19 Mar 2019 22:00:45 +0800 Subject: [PATCH] [improvement] Button: optimize type definitions (#3004) --- packages/button/index.tsx | 6 +++--- packages/icon/index.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/button/index.tsx b/packages/button/index.tsx index d9ccd4c34..2a8de69ad 100644 --- a/packages/button/index.tsx +++ b/packages/button/index.tsx @@ -8,9 +8,9 @@ import { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../utils/use/sfc'; export type ButtonProps = RouteProps & { - tag: keyof HTMLElementTagNameMap; - type: string; - size: string; + tag: keyof HTMLElementTagNameMap | string; + type: 'default' | 'primary' | 'info' | 'warning' | 'danger'; + size: 'large' | 'normal' | 'small' | 'mini' text?: string; block?: boolean; plain?: boolean; diff --git a/packages/icon/index.tsx b/packages/icon/index.tsx index d87b746ca..67fe55de3 100644 --- a/packages/icon/index.tsx +++ b/packages/icon/index.tsx @@ -8,7 +8,7 @@ import { CreateElement, RenderContext } from 'vue/types'; import { DefaultSlots } from '../utils/use/sfc'; export type IconProps = { - tag: keyof HTMLElementTagNameMap; + tag: keyof HTMLElementTagNameMap | string; name: string; size?: string; color?: string;