You could just put the +34 in your span
<span> +34 {{ globals.phoneNumber }}</span>
If you want something more sophisticated have a look at
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everybody! I'm new to vue and was wondering what would be the best way to add a prefix to my phone number variable.
Say I in my template I have curly braces interpolation like this:
<span> {{ globals.phoneNumber }}</span>
but want to add the prefix: +34 to the value of globals.phoneNumber variable, what would be the best way to do it? I don't want to create ANOTHER variable just for this and concatenate the strings!
To be honest in reflection of your entire problem just create a computed property
computed: {
phoneLink: function(){
return 'tel:+34' + APP.globals.appBookingPhone;
}
...
<a class="header_small_phone_number" :href="phoneLink" ...
Depending on where your APP variable has been declared you might need to use this.APP
Please or to participate in this conversation.