Skip to content

Inserting Raw HTML

MrCai edited this page Jul 22, 2022 · 1 revision

c-html directive can insert raw HTML into a container node.

This may be helpful when integrating with third-party libraries, e.g. render HTML generated from markdown.

<!-- index.html -->
<div c-html="rawHtml" />
// main.ts
data: {
  rawHtml: "<p>Hello world</p>"
}
<!-- Compile result -->
<div>
  <p>Hello world</p>
</div>
Clone this wiki locally