How to bind data to attributes
Created
April 15, 2018 09:47
-
-
Save A-Programmer/6ff00e510a46475b0e719686c49cd495 to your computer and use it in GitHub Desktop.
vue data binding
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"> | |
<a v-bind:href="websiteTag">My Site<a/> | |
<br/> | |
<input v-bind:value="name"/> | |
</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: { | |
name: 'Kamran', | |
websiteTag: 'http://sadin.ir' | |
} | |
}); |
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> |
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
body{ | |
font-family:tahoma; | |
font-size:12px; | |
font-weight:bold; | |
line-height:26px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment