Skip to content

Instantly share code, notes, and snippets.

@rdegges
Created July 20, 2017 21:22
Show Gist options
  • Save rdegges/696994c35f308ee5df86ca6845603c06 to your computer and use it in GitHub Desktop.
Save rdegges/696994c35f308ee5df86ca6845603c06 to your computer and use it in GitHub Desktop.
Two-way data binding in Vue.js.
<html>
<body>
<div id="app">
<p>What's your favorite color?</p>
<input v-model="color" type="text">
<p>Your favorite color is... {{ color }}</p>
</div>
<script src="https://unpkg.com/vue"></script>
<script>
let app = new Vue({
el: "#app",
data: {
color: ''
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment