import { use } from '../utils'; import { emit, inherit } from '../utils/functional'; import Cell from '../cell'; const [sfc, bem, t] = use('contact-card'); function ContactCard(h, props, slots, ctx) { const { type, editable } = props; return ( { if (editable) { emit(ctx, 'click', event); } }} {...inherit(ctx)} > {type === 'add' ? props.addText || t('addText') : [
{`${t('name')}:${props.name}`}
,
{`${t('tel')}:${props.tel}`}
]}
); } ContactCard.props = { tel: String, name: String, addText: String, editable: { type: Boolean, default: true }, type: { type: String, default: 'add' } }; export default sfc(ContactCard);