In this example i show how we can render html tag from a data on page by vue
Created
April 15, 2018 15:33
-
-
Save A-Programmer/3d717eec54199a780c1620746b6a1f6a to your computer and use it in GitHub Desktop.
Bind html tag from data in vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="vue-app"> | |
<p v-html="websiteHtmlTag"></p> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue ({ | |
el: '#vue-app', | |
data: { | |
websiteHtmlTag: '<a href="http://sadin.ir">My Site</a>' | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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