From c9abb07a7a23d60f38af8a3ef0ba98d0d2480693 Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 9 Feb 2021 20:49:40 +0800 Subject: [PATCH] types(ContactCard): use tsx (#8112) --- src/contact-card/{index.js => index.tsx} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename src/contact-card/{index.js => index.tsx} (85%) 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); }