Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save A-Programmer/3d717eec54199a780c1620746b6a1f6a to your computer and use it in GitHub Desktop.
Save A-Programmer/3d717eec54199a780c1620746b6a1f6a to your computer and use it in GitHub Desktop.
Bind html tag from data in vue

Bind html tag from data in vue

In this example i show how we can render html tag from a data on page by vue

A Pen by Kamran on CodePen.

License.

<div id="vue-app">
<p v-html="websiteHtmlTag"></p>
</div>
new Vue ({
el: '#vue-app',
data: {
websiteHtmlTag: '<a href="http://sadin.ir">My Site</a>'
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.13/vue.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment