Output Html in VueJs (v-html) Leave a comment

After the tried output HTML data in VueJs, we see that it show also HTML tags and attributes. For output HTML data in Vue, use v-html . Example:

data: {
        testUrlWithHtml: '<a href="https://extra.codes"> extra.codes </a>'
<p v-html="testUrlWithHtml"></p>

Used v-html=”testUrlWithHtml” instead of {{ testUrlWithHtml }}

Leave a Reply

Your email address will not be published. Required fields are marked *