2018-08-27 14:05:46 +08:00

47 lines
824 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<cell
center
:border="false"
:class="b([type])"
:is-link="editable"
:icon="type === 'edit' ? 'contact' : 'add2'"
@click="onClick"
>
<template v-if="type === 'add'">{{ addText || $t('addText') }}</template>
<template v-else>
<div>{{ $t('name') }}{{ name }}</div>
<div>{{ $t('tel') }}{{ tel }}</div>
</template>
</cell>
</template>
<script>
import create from '../utils/create';
export default create({
name: 'contact-card',
props: {
tel: String,
name: String,
addText: String,
editable: {
type: Boolean,
default: true
},
type: {
type: String,
default: 'add'
}
},
methods: {
onClick(event) {
if (this.editable) {
this.$emit('click', event);
}
}
}
});
</script>