| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
- import { use } from '../utils';
- import { emit, inherit } from '../utils/functional';
- import Cell from '../cell'; // Types
- var _use = use('contact-card'),
- sfc = _use[0],
- bem = _use[1],
- t = _use[2];
- function ContactCard(h, props, slots, ctx) {
- var type = props.type,
- editable = props.editable;
- return h(Cell, _mergeJSXProps([{
- "attrs": {
- "center": true,
- "border": false,
- "isLink": editable,
- "valueClass": bem('value'),
- "icon": type === 'edit' ? 'contact' : 'add-square'
- },
- "class": bem([type]),
- "on": {
- "click": function click(event) {
- if (editable) {
- emit(ctx, 'click', event);
- }
- }
- }
- }, inherit(ctx)]), [type === 'add' ? props.addText || t('addText') : [h("div", [t('name') + "\uFF1A" + props.name]), h("div", [t('tel') + "\uFF1A" + props.tel])]]);
- }
- ContactCard.props = {
- tel: String,
- name: String,
- addText: String,
- editable: {
- type: Boolean,
- "default": true
- },
- type: {
- type: String,
- "default": 'add'
- }
- };
- export default sfc(ContactCard);
|