'VueJS - usage of v-html attribute not working

In my case, I am replacing a link on top of paragraph element using v-html

Please find the code snippet as follows

 <p v-html="websiteHTML"></p>

where websiteHTML contains: <a v-bind:href="google.com/">Google</a>

The <p> tag is being rendered with Google but doesn't have hyperlink to navigate to https://www.google.com/

Could you please help in finding the error?



Solution 1:[1]

if you want to pass a var inside your link.

const url: string = 'https://google.fr/'
const html: string = `<a href="${url}">Google</a>`
<p v-html="html"></p>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jonathan Pretre