types(ContactCard): use tsx (#8112)

This commit is contained in:
neverland 2021-02-09 20:49:40 +08:00 committed by GitHub
parent 865f72bd5b
commit c9abb07a7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<ContactCardType>,
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);
}