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: {