Skip to content

Instantly share code, notes, and snippets.

@earth774
Created March 18, 2019 06:28
Show Gist options
  • Save earth774/1c1c2585f5b47a02d9535617ae71ce48 to your computer and use it in GitHub Desktop.
Save earth774/1c1c2585f5b47a02d9535617ae71ce48 to your computer and use it in GitHub Desktop.
2 way data binding input
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Amiearth</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<input v-model="message" placeholder="edit me">
<p>Message is: {{ message }}</p>
</div>
<script>
var example2 = new Vue({
el: '#app',
data: {
message: 'Vue.js'
}
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment