Force http on links

This commit is contained in:
Ramon Wenger 2019-05-09 09:18:21 +02:00
parent 545f3adb41
commit 28f96f8517
1 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="link-block"> <div class="link-block">
<link-icon class="link-block__icon"></link-icon> <link-icon class="link-block__icon"></link-icon>
<a :href="value.url" class="link-block__link" target="_blank">{{value.text}}</a> <a :href="href" class="link-block__link" target="_blank">{{value.text}}</a>
</div> </div>
</template> </template>
@ -13,6 +13,13 @@
components: { components: {
LinkIcon LinkIcon
},
computed: {
href() {
const url = this.value.url;
return url.startsWith('http') ? this.value.url : `http://${this.value.url}`;
}
} }
} }
</script> </script>