Sử dụng cú pháp mustache: {{ rawHtml }}
Sử dụng directive v-html:
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="example1" class="demo">
<p>Sử dụng cú pháp mustache: {{ rawHtml }}</p>
<p>Sử dụng directive v-html: <span v-html="rawHtml"></span></p>
</div>
<script>
new Vue({
el: '#example1',
data: function () {
return {
rawHtml: '<span style="color: red"></span>'
}
}
})
</script>
</body>
</html>