Categories
Vue Answers

How to display unescaped HTML in Vue.js?

Spread the love

To display unescaped HTML in Vue.js, we can use the v-html directive.

For instance, we write

<template>
  <div id="logapp">
    <table>
      <tbody>
        <tr v-repeat="logs">
          <td v-html="fail"></td>
          <td v-html="type"></td>
          <td v-html="description"></td>
          <td v-html="stamp"></td>
          <td v-html="id"></td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

to set v-html to the reactive properties with the HTML we want to render dynamically.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

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