diff --git a/src/contact-card/index.js b/src/contact-card/index.tsx similarity index 85% rename from src/contact-card/index.js rename to src/contact-card/index.tsx index 43765181a..2c695d006 100644 --- a/src/contact-card/index.js +++ b/src/contact-card/index.tsx @@ -1,8 +1,11 @@ +import { PropType } from 'vue'; import { createNamespace } from '../utils'; import Cell from '../cell'; const [createComponent, bem, t] = createNamespace('contact-card'); +export type ContactCardType = 'add' | 'edit'; + export default createComponent({ props: { tel: String, @@ -13,7 +16,7 @@ export default createComponent({ default: true, }, type: { - type: String, + type: String as PropType, default: 'add', }, }, @@ -21,7 +24,7 @@ export default createComponent({ emits: ['click'], setup(props, { emit }) { - const onClick = (event) => { + const onClick = (event: MouseEvent) => { if (props.editable) { emit('click', event); }