fix event bubble
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
:href="href || undefined"
|
||||
class="telephone-link"
|
||||
:class="{ clickable: !!href }"
|
||||
@click.stop
|
||||
@click="handleClick"
|
||||
>
|
||||
<span v-text="displayText" />
|
||||
</component>
|
||||
@@ -28,6 +28,12 @@ const props = withDefaults(defineProps<{
|
||||
const textValue = computed(() => props.value?.trim() || "");
|
||||
const displayText = computed(() => textValue.value || props.placeholder);
|
||||
const href = computed(() => canDialTelephone(textValue.value) ? buildTelephoneURL(textValue.value) : "");
|
||||
|
||||
function handleClick(event: MouseEvent): void {
|
||||
if (textValue.value) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
Reference in New Issue
Block a user