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