0👍
You could use v-html
directive which is used to render a static html content that doesn’t require any event handling or data binding, and according to official doc:
The contents of the
span
will be replaced with the value of therawHtml
property, interpreted as plain HTML – data bindings are ignored. Note that you cannot usev-html
to compose template partials, because Vue is not a string-based templating engine. Instead, components are preferred as the fundamental unit for UI reuse and composition
another solution is to use the package v-runtime-template
found in https://github.com/alexjoverm/v-runtime-template
This is probably useful for your use case, with all the usual concerns about safety of these approaches against malicious injections.