From 5e0913465667595b907d0638f4f6ce48443bb24a Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 19 Sep 2020 23:15:39 +0800 Subject: [PATCH] types(Icon): use tsx --- src/icon/{index.js => index.tsx} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename src/icon/{index.js => index.tsx} (88%) diff --git a/src/icon/index.js b/src/icon/index.tsx similarity index 88% rename from src/icon/index.js rename to src/icon/index.tsx index 84b2141e0..d7b920172 100644 --- a/src/icon/index.js +++ b/src/icon/index.tsx @@ -1,9 +1,10 @@ +import { PropType } from 'vue'; import { addUnit, createNamespace } from '../utils'; import Badge from '../badge'; const [createComponent, bem] = createNamespace('icon'); -function isImage(name) { +function isImage(name?: string) { return name ? name.indexOf('/') !== -1 : false; } @@ -15,7 +16,7 @@ export default createComponent({ badge: [Number, String], color: String, tag: { - type: String, + type: String as PropType, default: 'i', }, classPrefix: {