Raw or render HTML in Vue

- Andrés Cruz

En español
Raw or render HTML in Vue

Many times we have HTML content in a property or function that we want to render directly in the template; if we do it the usual way with braces {{}} it won't get the desired result, we have to use the v-html directive instead and tell it the property or function.

    <!-- **RAW HTML -->
      {{ rawhtml }}
    <p v-html="rawhtml"></p>
    <!-- **RAW HTML FIN-->

And in the JavaScript

rawhtml: "<span style='color:red'>Hola texto rojo</span>",

You can check the repo for more information.

Andrés Cruz

Desarrollo con Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz en Udemy

Acepto recibir anuncios de interes sobre este Blog.