38 lines
683 B
Vue
38 lines
683 B
Vue
<template>
|
|
<contact-number :value="value" @click="handleClick" underline>
|
|
<template #icon>
|
|
<t-icon v-if="value" name="call" />
|
|
</template>
|
|
</contact-number>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ContactNumber } from "timi-web";
|
|
|
|
defineOptions({
|
|
name: "TelephoneLink"
|
|
});
|
|
|
|
const props = withDefaults(defineProps<{
|
|
placeholder?: string;
|
|
value?: string;
|
|
}>(), {
|
|
placeholder: ""
|
|
});
|
|
|
|
const textValue = computed(() => props.value?.trim() || "");
|
|
|
|
function handleClick(event: MouseEvent): void {
|
|
if (textValue.value) {
|
|
event.stopPropagation();
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.telephone-link {
|
|
word-break: break-all;
|
|
text-decoration: none;
|
|
}
|
|
</style>
|